let initDB = function() {
	initUser();
	initCommon();
	initMeter();
	initRepair();
	initTransact();
	initSecuryty();
	initMaterial();
	initCharge();
	initSinglePrice();
	initUserFloor();
	initChargeResult();
	initArrageUser();
	initUserChange();
	initRelation();
	inspectionInfo();
	verificationInfo();
	maintenanceInfo();
}

/**
 * 用户档案信息建表
 */
function initUser() {
	var userInfoDBSql = [{
		"dbVersion": 1,
		"execTable": [{
			"tableVersion": 1,
			"tableName": "CUST_ADDRINFO", //6.2.1.1	用户基本信息（CUST_ADDRINFO）
			"execSQL": "CREATE TABLE IF NOT EXISTS CUST_ADDRINFO( TS_TYPE VARCHAR(8), APP_NO VARCHAR(16), CUST_NO VARCHAR(16),CUST_ID NUMBER(16), CUST_TYPE VARCHAR(8), CUST_NAME VARCHAR(256), CUST_ADDR VARCHAR(256), CONS_NO VARCHAR(16),CONS_ID NUMBER(16), ORGN_CONS_NO VARCHAR(32),CONS_STAT VARCHAR(8), CONS_NAME VARCHAR(256),CONS_ADDR VARCHAR(256),USER_DOC VARCHAR(8),GAS_NARURE VARCHAR(8),FLAG_CODE VARCHAR(32),SC_TYPE VARCHAR(16),LAST_CHK_DATE VARCHAR(16),ORG_NO VARCHAR(16),PRESENT_NAME VARCHAR(256),CONS_SORT_CODE VARCHAR(16),RESIDENT_POPU NUMBER(5)); CREATE INDEX CUST_ADDRINFO_INDEX ON CUST_ADDRINFO( APP_NO,CONS_NO );"
		}, {
			"tableVersion": 1,
			"tableName": "CUST_CONTACTINFO", //6.2.1.2	联系信息（CUST_CONTACTINFO）
			"execSQL": "CREATE TABLE IF NOT EXISTS CUST_CONTACTINFO(M_CID VARCHAR(32),CONTACT_ID NUMBER(16) NOT NULL,TS_TYPE VARCHAR(8),APP_NO VARCHAR(16),CONS_NO VARCHAR(16),CONTACT_NAME VARCHAR(32),RELATION VARCHAR(8),SEX VARCHAR(8),CONTACT_TYPE VARCHAR(8),CONTACT_PRIO NUMBER(5),REMARK VARCHAR(1024),CERT_TYPE VARCHAR2(8),CERT_NUM VARCHAR2(32));CREATE INDEX CUST_CONTACTINFO_INDEX ON CUST_CONTACTINFO( APP_NO,CONS_NO);"
		}, {
			"tableVersion": 1,
			"tableName": "CONT_CHANL", //6.2.1.2.1	联系方式信息（CONT_ CHANL） CUST_CONTACTINFO.CONTACT_ID与CONT_CHANL.CONTACT_ID关联
			"execSQL": "CREATE TABLE IF NOT EXISTS CONT_CHANL(APP_NO VARCHAR(16),CONS_NO VARCHAR(16),CONS_C_CHANL_ID NUMBER(16) NOT NULL,CONTACT_ID NUMBER(16) NOT NULL,CONT_CHANL_TYPE VARCHAR(8),CONT_CHANL_NO VARCHAR(32),PRIORITY NUMBER(5));CREATE INDEX CONT_CHANL_INDEX ON CONT_CHANL( CONTACT_ID);"
		}, {
			"tableVersion": 1,
			"tableName": "CUST_GMINFO", //6.2.1.3	表具信息（CUST_GMINFO）
			"execSQL": "CREATE TABLE IF NOT EXISTS CUST_GMINFO(TS_TYPE VARCHAR(8),APP_NO VARCHAR(16),CONS_NO VARCHAR(16),MR_SECT_NO VARCHAR(16),MR_SN NUMBER(5),VENT_DATE VARCHAR(16),PURCH_GAS_TIME VARCHAR(16),THIS_YMD VARCHAR(16),LAST_MR NUMBER(16,6),METER_ID NUMBER(6),GM_APPLY_TYPE VARCHAR(8),PRODUCE_FACT VARCHAR(8),METER_MODEL VARCHAR(32),ASSET_NO VARCHAR(32),INTAKE_DIRE VARCHAR(8),INST_LOC VARCHAR(256),MR_DIGIT NUMBER(5),T_FACTOR NUMBER(16),PURCH_T_CAP NUMBER(18,6),MP_ID NUMBER(16),ORG_NO VARCHAR(16),ACCU_PURCH_GC VARCHAR(32),BURG_NUM VARCHAR2(32),THIS_MR NUMBER(18,6));CREATE INDEX CUST_GMINFO_INDEX ON CUST_GMINFO( APP_NO,CONS_NO);"
		}, {
			"tableVersion": 1,
			"tableName": "CUST_PRODINFO", //6.2.1.4	燃气设备信息（CUST_PRODINFO）
			"execSQL": "CREATE TABLE IF NOT EXISTS CUST_PRODINFO(EQUIP_USE VARCHAR2(8),EQUIP_USE_TYPE VARCHAR2(8),PURCHASE_PLACE VARCHAR2(256),EQUIP_INS_MODE VARCHAR2(8),M_EQUIPID VARCHAR(32),TS_TYPE VARCHAR(8),APP_NO VARCHAR(16),CONS_NO VARCHAR(16),FACTORY_NUMBER VARCHAR(32),EQUIP_ID NUMBER(16),MP_ID NUMBER(16),EQUIT_TYPE VARCHAR(8),PROD_TYPE_NO VARCHAR(16),PROD_BRAND VARCHAR(256),PROD_MODEL VARCHAR(32),PROD_BAR VARCHAR(256),PURCHASE_TIME VARCHAR(16),INST_DATE VARCHAR(16),INST_ADD VARCHAR(256),QUANTITY NUMBER(5),ORG_NO VARCHAR(16));CREATE INDEX CUST_PRODINFO_INDEX ON CUST_PRODINFO( APP_NO,CONS_NO);"
		}, {
			"tableVersion": 1,
			"tableName": "PIPE_VALVEINFO", //6.2.1.5	管线阀门信息（PIPE_VALVEINFO）
			"execSQL": "CREATE TABLE IF NOT EXISTS PIPE_VALVEINFO(FACILITY_ID NUMBER(16),FACILITY_CODE VARCHAR2(8),FACILITY_TYPE VARCHAR2(8),FACILITY_NAME VARCHAR2(8),FACILITY_MODEL VARCHAR2(8),FACILITY_QUALITY VARCHAR2(8),CONNECTION_MODE VARCHAR2(8),INSTALL_MODE VARCHAR2(8),CURRENT_STATE VARCHAR2(8),FACILITY_SOURCE VARCHAR2(8),REMARK VARCHAR2(1024),OPERAT_PRESSURE VARCHAR2(32),FACTORY VARCHAR2(32),FACILITY_NUM VARCHAR2(32),ADDR_POSITION VARCHAR2(256),SC_DATE VARCHAR2(32),ORG_NO VARCHAR2(16),CONS_NO VARCHAR2(16),P_FACILITY_ID VARCHAR2(32),RELA_FACILITY_ID NUMBER(16),FACILITY_LEVEL VARCHAR2(16),FACILITY_CONFIGURE VARCHAR2(16),FACILITY_NO VARCHAR2(16),P_M_CID VARCHAR2(32))"
		}, {
			"tableVersion": 1,
			"tableName": "CONS_LABLEINFO", //6.2.1.6 用户标签信息（CONS_LABLEINFO）
			"execSQL": "CREATE TABLE IF NOT EXISTS CONS_LABLEINFO(CONS_NO VARCHAR2(16),ID NUMBER(16),LABLE_TYPE VARCHAR2(8),LABLE_VALUE VARCHAR2(8),UPD_FLAG VARCHAR2(8),LABLE_DESC VARCHAR2(256),UDP_FLAG VARCHAR2(8),UDP_TYPE VARCHAR2(8),UDP_DATE VARCHAR2(16),UDP_EMP VARCHAR2(256),FLAG_TYPE VARCHAR2(16),FLAG_CODE VARCHAR2(16));CREATE INDEX CONS_LABLEINFO_INDEX ON CONS_LABLEINFO( CONS_NO );"
		}, {
			"tableVersion": 1,
			"tableName": "TS_RES", //6.2.1.7	抄表信息（TS_RES）
			"execSQL": "CREATE TABLE IF NOT EXISTS TS_RES(APP_NO VARCHAR(16),CONS_NO VARCHAR(16),MR_TYPE_CODE NUMBER(8),THIS_YMD VARCHAR(16),LAST_MR_NUM NUMBER(18,6),THIS_READ NUMBER(18,6),THIS_READ_GQ NUMBER(18,6),ELEC_METER_READ NUMBER(18,6),REMAIN_GAS NUMBER(18,6),EXCP_TYPE_CODE VARCHAR(8),MR_SN NUMBER(5),T_FACTOR NUMBER(16),MR_DIGIT NUMBER(5),ORG_NO VARCHAR(8));CREATE INDEX TS_RES_INDEX ON TS_RES( APP_NO,CONS_NO );"
		}, {
			"tableVersion": 1,
			"tableName": "INSU_INFO", //6.2.1.8	保险信息（INSU_INFO）
			"execSQL": "CREATE TABLE IF NOT EXISTS INSU_INFO(INSUR_PROD VARCHAR2(256),CONS_NO VARCHAR2(16),INSUR_TYPE VARCHAR2(8),COPIES VARCHAR2(8),AMT NUMBER(18,2),SAFE_PERIOD VARCHAR2(8),SAFE_BGN_DATE VARCHAR2(16),SAFE_END_DATE VARCHAR2(16));CREATE INDEX INSU_INFO_INDEX ON INSU_INFO( CONS_NO );"
		}, {
			"tableVersion": 1,
			"tableName": "CERT_LIST", //6.2.1.9	证件信息（CERT_LIST）
			"execSQL": "CREATE TABLE IF NOT EXISTS CERT_LIST(APP_NO VARCHAR2(16),CUST_NO VARCHAR2(16),CERT_ID NUMBER(16),M_CID VARCHAR2(32),CERT_TYPE VARCHAR2(8),CERT_NAME VARCHAR2(256),GIVE_CERT_ANENT VARCHAR2(256),CERT_NUM VARCHAR2(32),CARD_DATE VARCHAR2(32),VALID_PERIOD NUMBER (5),EFFECT_TIME VARCHAR2(32),INVALID_TIME VARCHAR2(32),SAVE_LOC VARCHAR2(256),REMARK VARCHAR2(1024),ORG_NO VARCHAR2(16))"
		}, {
			"tableVersion": 1,
			"tableName": "BANK_LIST", //6.2.1.10	银行信息（BANK_LIST）
			"execSQL": "CREATE TABLE IF NOT EXISTS BANK_LIST(APP_NO VARCHAR2(16),CONS_NO VARCHAR2(16),ACCT_ID NUMBER(16),M_CID VARCHAR2(32),PRIORITY VARCHAR2(8),BANK_CODE VARCHAR2(8),BANK_ACCT VARCHAR2(32),ACCOUNT_NAME VARCHAR2(256),REMARK VARCHAR2(256),ORG_NO VARCHAR2(16))"
		}, {
			"tableVersion": 1,
			"tableName": "NOTE_INFO", //6.2.1.11	开票信息（NOTE_INFO）
			"execSQL": "CREATE TABLE IF NOT EXISTS NOTE_INFO(M_VAT_ID VARCHAR2(32), APP_NO VARCHAR2(16),CONS_NO VARCHAR2(16),VAT_NAME VARCHAR2(256),VAT_NO VARCHAR2(32),VAT_ACCT VARCHAR2(32),BANK_CODE VARCHAR2(256),REG_ADDR VARCHAR2(256),VAT_ADDR VARCHAR2(256),BILL_TYPE VARCHAR2(32),DRAW_BILL_TYPE VARCHAR2(32))"
		}, {
			"tableVersion": 1,
			"tableName": "MP_INFO", //6.2.1.12	供气点信息(MP_INFO)
			"execSQL": "CREATE TABLE IF NOT EXISTS MP_INFO(APP_NO VARCHAR2(16),CONS_NO VARCHAR2(16),MP_ID NUMBER(16),ADDR_ID NUMBER(16),MP_NO VARCHAR2(16),MP_ADDR VARCHAR2(256),INST_COND_FLAG VARCHAR2(8),PIPE_NET_TYPE VARCHAR2(8),HAS_SRC_TYPE VARCHAR2(8),RISER_VENT_STAT VARCHAR2(8),RISER_VENT_DATE VARCHAR2(32),IN_INST_STAT VARCHAR2(8),INPIPE_LAY_TYPE VARCHAR2(8),INST_DATE VARCHAR2(32),PRO_ACPT_DATE VARCHAR2(32),VENT_STAT VARCHAR2(8),VENT_DATE VARCHAR2(32),OPEN_PAY_FLAG VARCHAR2(8),BELONG_REGU_BOX VARCHAR2(32),METER_BOX_NO VARCHAR2(16),BELONG_RISER_NO VARCHAR2(16),ORG_NO VARCHAR2(16),BELONG_AREA VARCHAR2(16),LONGITUDE VARCHAR2(32),LATITUDE VARCHAR2(32),GAS_NARURE VARCHAR2(8),CONS_ID NUMBER(16),CALC_MODE VARCHAR2(8),MP_TYPE_CODE VARCHAR2(8),MP_LEVEL NUMBER(5),PRC_CODE VARCHAR2(32),TRADE_CODE VARCHAR2(8),MP_STATUS VARCHAR2(8),MR_SN NUMBER(5),TP_FACTOR NUMBER(18,6),PIPE_NET_NO VARCHAR2(16),FACILITY_NO VARCHAR2(16),NO_VENT_DEAL VARCHAR2(8),GAS_USE VARCHAR2(8),M_CID VARCHAR2(32));"
		}, {
			"tableVersion": 1,
			"tableName": "CUST_COUTRACTINFO", //6.2.1.13	合同信息(CUST_COU)
			"execSQL": "CREATE TABLE IF NOT EXISTS CUST_COUTRACTINFO(APP_NO VARCHAR2(16),CONS_NO VARCHAR2(16),CONT_ID NUMBER(16),CONS_ID NUMBER(16),CONT_NO VARCHAR2(32),FILE_NAME VARCHAR2(256),ELEC_FILE_NAME VARCHAR2(32),CT_CONTACT_NO VARCHAR2(16),CONT_MODEL VARCHAR2(8),CONTR_SORT VARCHAR2(8),CONT_STAT VARCHAR2(8),SIGN_PER VARCHAR2(256),SIGN_ADDR VARCHAR2(256),CONT_SIGN_DATE VARCHAR2(32),EFFECT_DATE VARCHAR2(32),VALID_PERIOD NUMBER(5),END_DATE VARCHAR2(32),SUPPLY_SIGN_PER VARCHAR2(32),REMARK VARCHAR2(1024),FOREIG NUMBER(16),ORG_NO VARCHAR2(16),CERT_TYPE VARCHAR2(8),CERT_NUM VARCHAR2(32),CONT_PHONE VARCHAR2(32),CANCE_REA VARCHAR2(256),CANCE_OPER VARCHAR2(16),SIGN_TYPE VARCHAR2(8),SIGN_CHANNEL VARCHAR2(8),SIGN_ORG_NO VARCHAR2(16),BUILD_AREA VARCHAR2(32),AGENT VARCHAR2(256))"
		}, {
			"tableVersion": 1,
			"tableName": "CONTR_BASE_INFO", //6.2.1.13.1	合同用气信息
			"execSQL": "CREATE TABLE IF NOT EXISTS CONTR_BASE_INFO(BASE_INFO_ID NUMBER(16),CONT_ID NUMBER(16),GAS_NARURE VARCHAR2(8),PRC_TYPE VARCHAR2(16),PRE_GAS_AMT NUMBER(18,2),GM_TYPE VARCHAR2(8),FLOW NUMBER(18,6),APP_RUN_CAP NUMBER(18,6),YEAT_RUN_CAP NUMBER(18,6),PRC_CODE VARCHAR2(16),PRC_NAME VARCHAR2(32),ORG_NO VARCHAR2(16))"
		}, {
			"tableVersion": 1,
			"tableName": "CONTR_SUB_INFO", //6.2.1.13.1	合同用气信息
			"execSQL": "CREATE TABLE IF NOT EXISTS CONTR_SUB_INFO(CONT_SUB_ID NUMBER(16),CONT_ID NUMBER(16),SUB_TYPE VARCHAR2(8),CUST_NAME VARCHAR2(256),REG_PERSON VARCHAR2(32),REG_ADDR VARCHAR2(256),AUTH_AGENT VARCHAR2(32),TEL VARCHAR2(32),FAX VARCHAR2(32),POSTAL_CODE VARCHAR2(16),OPEN_BANK VARCHAR2(32),BANK_ACCT VARCHAR2(32),TAX_REGIST_NO VARCHAR2(32),ORG_NO VARCHAR2(16))"
		}, {
			"tableVersion": 1,
			"tableName": "ACCOUNT_LIST", //5.5.15.3.1	用户账户信息
			"execSQL": "CREATE TABLE IF NOT EXISTS ACCOUNT_LIST(CONS_NO VARCHAR(16),COMMI_CHARGE_BANK VARCHAR(256),BANK_ACCT VARCHAR(32),UPDATE_TIME VARCHAR(16),ACCOUNT_BAL NUMBER(18,2),PREPAY_BAL NUMBER(18,2),OWE_BAL NUMBER(18,2),PENALTY_AMT NUMBER(18,2),OWE_NUM NUMBER(8));CREATE INDEX ACCOUNT_LIST_INDEX ON ACCOUNT_LIST( CONS_NO );"
		}, {
			"tableVersion": 1,
			"tableName": "OWE_LIST", //5.5.15.3.2	欠费明细信息
			"execSQL": "CREATE TABLE IF NOT EXISTS OWE_LIST(CONS_NO VARCHAR(16),RCVBL_GAS_ID NUMBER(16),RCVBL_YM VARCHAR(6),RELEASE_DATE VARCHAR(8),THIS_READ NUMBER(18,2),SETTLE_TQ NUMBER(18,2),RCVBL_AMT NUMBER(18,2),RCVED_AMT NUMBER(18,2),PENALTY NUMBER(18,2),OWE_TOTAL_AMT NUMBER(18,2),DEADLINE_DATE VARCHAR(16),SETTLE_FLAG VARCHAR(8));CREATE INDEX OWE_LIST_INDEX ON OWE_LIST( APP_NO,CUST_NO,CONS_NO);"
		}, {
			"tableVersion": 1,
			"tableName": "PAY_LIST", //5.5.15.3.3	缴费记录信息
			"execSQL": "CREATE TABLE IF NOT EXISTS PAY_LIST(RCV_ORG_NAME VARCHAR2(32),CONS_NO VARCHAR2(16),PAY_MODE VARCHAR2(8),SETTLE_MODE VARCHAR2(8),TYPE_CODE VARCHAR2(8),CHARGE_EMP_NO VARCHAR2(256),RCVED_DATE VARCHAR2(8),CHARGE_TIME VARCHAR2(16),PAY_AMT NUMBER(18,2),RCVED_AMT NUMBER(18,2),PENALTY_AMT NUMBER(18,2),PREPAY_AMT NUMBER(18,2),BUSI_AMT NUMBER(18,2),ADD_AMT NUMBER(18,2),RCV_DEPT_NAME VARCHAR2(128));CREATE INDEX PAY_LIST_INDEX ON PAY_LIST( APP_NO );"
		}]
	}];
	AndroidApi.initCreateTables(JSON.stringify(userInfoDBSql), function(msg) {});
}

/**
 * 微应用公用数据库创建
 */
function initCommon() {
	var fileDBSql = [{
		"dbVersion": 1,
		"execTable": [{
			"tableVersion": 1,
			"tableName": "FILE_RECORDE",
			"execSQL": "CREATE TABLE IF NOT EXISTS FILE_RECORDE(APP_NO VARCHAR2(16),CONS_NO VARCHAR2(16), FILE_SRC VARCHAR2(128), FILE_NAME VARCHAR2(256), ITEM_NO VARCHAR2(16), BUSY_NO VARCHAR2(16),FILE_ID VARCHAR2(32));"
		}]
	}];
	AndroidApi.initCreateTables(JSON.stringify(fileDBSql), function(msg) {
		console.log("文件表建表结束：" + JSON.stringify(msg));
	});
}
/**
 * 抄表对应建表
 */
function initMeter() {
	let Mr_Data_Base = [{
		"dbVersion": 1,
		"execTable": [{
			"tableVersion": 1,
			"tableName": "METER_READING_DO", //下载列表
			"execSQL": "CREATE TABLE IF NOT EXISTS METER_READING_DO (_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NO VARCHAR2(32),MR_SECT_NO VARCHAR2(32),PLAN_MR_DATE VARCHAR2(32),PLAN_NUM INT,MR_SECT_NAME VARCHAR2(32),ADDR_NAME VARCHAR2(32),ORG_STATUS VARCHAR2(32),CB_STATUS VARCHAR2(32));"
		}, {
			"tableVersion": 1,
			"tableName": "METER_READING_DETAILS", //抄表明细
			"execSQL": "CREATE TABLE IF NOT EXISTS METER_READING_DETAILS (_id INTEGER PRIMARY KEY AUTOINCREMENT ,PLAN_STATUS VARCHAR2(32),TASK_STATUS VARCHAR2(32),MP_STATUS VARCHAR2(32),MP_CHK_STATUS VARCHAR2(32),APP_NO VARCHAR2(32),MR_ID INT,PRC_CODE VARCHAR2(32),CONS_NO VARCHAR2(32),PLAN_MR_DATE VARCHAR2(32),METER_ID INT,T_FACTOR INT,MR_DIGIT INT,LAST_MR_DATE VARCHAR2(32),LAST_MR_NUM INT,LAST_MR_GQ INT,MR_STATUS_CODE VARCHAR2(32),MR_TYPE_CODE VARCHAR2(32),THIS_YMD VARCHAR2(32),THIS_READ VARCHAR2(32),THIS_READ_GQ INT,EXCP_TYPE_CODE VARCHAR2(32),MR_SN INT,SRC_CODE VARCHAR2(32),ORG_NO VARCHAR2(32),TQ_MR_GQ VARCHAR2(32),MY_ROWNUM INT,EXT_GQ INT,ELEC_METER_READ INT,REMAIN_GAS INT,GM_APPLY_TYPE VARCHAR2(32),FACTORY_NUMBER VARCHAR2(32),LAST_ELECMETER_READ INT,LAST_REMAIN_GAS INT,ACTUAL_MODE VARCHAR2(32),IS_HISTORY VARCHAR2,MP_ID NUMBER(16),CUST_ID NUMBER(16),CUST_NO VARCHAR2(16),AMT_YM VARCHAR2(8));"
		}, {
			"tableVersion": 1,
			"tableName": "METER_READING_GAS_LIST", //燃气明细
			"execSQL": "CREATE TABLE IF NOT EXISTS METER_READING_GAS_LIST (_id INTEGER PRIMARY KEY AUTOINCREMENT ,CONS_NO VARCHAR2(32),APP_NO VARCHAR2(32),SN VARCHAR2(32),RCVBL_AMT NUMBER(18,2),PAY_AMT NUMBER(18,2),COPIES VARCHAR2(32),PAY_TYPE VARCHAR2(32),PAY_STATUS VARCHAR2(32),SETTLE_MODE VARCHAR2(8));"
		}, {
			"tableVersion": 1,
			"tableName": "METER_READING_NSUR_LIST", //保险列表
			"execSQL": "CREATE TABLE IF NOT EXISTS METER_READING_NSUR_LIST (_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NO VARCHAR2(32),CONS_NO VARCHAR2(32),SN VARCHAR2(32),INSUR_TYPE VARCHAR2(32),COPIES VARCHAR2(32),AMT INT,PUR_DATE VARCHAR2(32),PAY_TYPE VARCHAR2(32),PAY_STATUS VARCHAR2(32),SETTLE_MODE VARCHAR2(8),SAFE_BGN_DATE VARCHAR2(32),SAFE_END_DATE VARCHAR2(32),ISINS NUMBER(18,2));"
		}, {
			"tableVersion": 1,
			"tableName": "METER_READING_NAME", //现名称,用户手册发放
			"execSQL": "CREATE TABLE IF NOT EXISTS METER_READING_NAME (_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NO VARCHAR2(32),CONS_NO VARCHAR2(32),GRANT_TIME VARCHAR2(32),USER_ALIAS VARCHAR2(64));"
		}, {
			"tableVersion": 1,
			"tableName": "METER_READING_TAGS", //标签
			"execSQL": "CREATE TABLE IF NOT EXISTS METER_READING_TAGS (_id INTEGER PRIMARY KEY AUTOINCREMENT ,ID NUMBER(16),APP_NO VARCHAR2(32),CONS_NO VARCHAR2(32),FLAG_CODE VARCHAR2(16),UPD_FLAG VARCHAR2(8),LABLE_TYPE VARCHAR2(16),LABLE_VALUE VARCHAR2(16));"
		}, {
			"tableVersion": 1,
			"tableName": "METER_READING_DEVICE", //设备核对
			"execSQL": "CREATE TABLE IF NOT EXISTS METER_READING_DEVICE (_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NO VARCHAR2(32),CONS_NO VARCHAR2(32),DEV_TYPE VARCHAR2(8),CHK_STATUS VARCHAR2(8),LABLE_TYPE VARCHAR2(16),LABLE_VALUE VARCHAR2(16),CHK_TIME VARCHAR2(32));"
		}, {
			"tableVersion": 1,
			"tableName": "HISTORY_RECORD", //6.15.4	历史抄表信息
			"execSQL": "CREATE TABLE IF NOT EXISTS HISTORY_RECORD(CONS_NO VARCHAR2(16),APP_NO VARCHAR2(16),LAST_MR_NUM NUMBER(18,6),MR_ID NUMBER(16),GM_APPLY_TYPE VARCHAR2(8),FACTORY_NUMBER VARCHAR2(16),T_FACTOR NUMBER(16),PLAN_MR_DATE VARCHAR2(8),METER_ID NUMBER(16),LAST_MR_GQ NUMBER(18,6),LAST_MR_DATE VARCHAR2(8),MR_STATUS_CODE VARCHAR2(8),MR_TYPE_CODE VARCHAR2(8),THIS_YMD VARCHAR2(16),THIS_READ NUMBER(16),THIS_READ_GQ NUMBER(18,6),LAST_ELECMETER_READ NUMBER(18,6),LAST_REMAIN_GAS NUMBER(18,6),ELEC_METER_READ NUMBER(18,6),REMAIN_GAS NUMBER(18,6),EXCP_TYPE_CODE VARCHAR2(8),MR_SN NUMBER(5),ACTUAL_MODE VARCHAR2(8),ORG_NO VARCHAR2(16),AMT_YM VARCHAR2(16),THIS_AMT VARCHAR2(16));CREATE INDEX HISTORY_RECORD_INDEX ON HISTORY_RECORD( CONS_NO );"
		}]
	}];
	AndroidApi.initCreateTables(JSON.stringify(Mr_Data_Base), function(msg) {
		console.log("所有表建立结束:" + JSON.stringify(msg));
	});

}

/**
 * 维修项目对应建表
 */
function initRepair() {
	var repairDBSql = [{
		"dbVersion": 1,
		"execTable": [{
			"tableVersion": 1,
			"tableName": "Repair_TSINFO", //6.3.2	维修任务下载
			"execSQL": "CREATE TABLE IF NOT EXISTS Repair_TSINFO(_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NO VARCHAR(16), TS_TYPE VARCHAR(8),ORG_NO VARCHAR(16),CONS_NO VARCHAR(16),CONS_NAME VARCHAR(32),CONS_ADD VARCHAR(256),APPO_START_TIME VARCHAR(32),APPO_ARR_TIME VARCHAR(32),APPO_PER VARCHAR(256),CONTACT_TEL VARCHAR(32),REMARK VARCHAR(256), FAULT_ADDR VARCHAR(64), URGENCY_DEGREE VARCHAR(8), MAIN_STAT VARCHAR(8));"
		}, {
			"tableVersion": 1,
			"tableName": "RepairLoad_TSINFO", //下载后存的数据库
			"execSQL": "CREATE TABLE IF NOT EXISTS RepairLoad_TSINFO(_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NO VARCHAR(16),CONS_NO VARCHAR(16), TS_TYPE VARCHAR(8),ORG_NO VARCHAR(16),CONS_NAME VARCHAR(32),CONS_ADD VARCHAR(256),APPO_START_TIME VARCHAR(32),APPO_ARR_TIME VARCHAR(32),APPO_PER VARCHAR(256),CONTACT_TEL VARCHAR(32),REMARK VARCHAR(256), FAULT_ADDR VARCHAR(64), URGENCY_DEGREE VARCHAR(8), MAIN_STAT VARCHAR(8),STATUS VARCHAR(8),isChoose VARCHAR(8),APP_NAME VARCHAR(256));"
		}, {
			"tableVersion": 1,
			"tableName": "RepairDetail_Table", //6.3.3维修明细下载
			"execSQL": "CREATE TABLE IF NOT EXISTS RepairDetail_Table(_id INTEGER PRIMARY KEY AUTOINCREMENT ,AP_MAIN_REGI_ID NUMBER(64),APP_NO VARCHAR(16),CONS_NO VARCHAR(16),CONS_ID NUMBER(16),APPOINT_TYPE VARCHAR(8),FAULT_MODE VARCHAR(8),URGENCY_DEGREE VARCHAR(8),FAULT_DESC VARCHAR(1024),FAULT_ADDR VARCHAR(4000),DIST_TIME VARCHAR(64),APPO_TIME VARCHAR(32),APPO_ARR_TIME VARCHAR(32),CONTACT_TEL VARCHAR(32),CONTACT_PER VARCHAR2(32),CONTACT_TELTWO VARCHAR(32),REMARK VARCHAR(4000),SRC_CODE VARCHAR(8));"
		}, {
			"tableVersion": 1,
			"tableName": "RepairFault_Table", //6.3.3.1维修故障类型信息
			"execSQL": "CREATE TABLE IF NOT EXISTS RepairFault_Table(_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NO VARCHAR(16),CONS_NO VARCHAR(16),FAULT_ID NUMBER(16),FAULT_TYPE VARCHAR(16));"
		}, {
			"tableVersion": 1,
			"tableName": "TURC_INFO_Table", //6.3.3.2维修现场施工信息
			"execSQL": "CREATE TABLE IF NOT EXISTS TURC_INFO_Table(_id INTEGER PRIMARY KEY AUTOINCREMENT,APP_NO VARCHAR(16),CONS_NO VARCHAR(16),CONS_RST_ID NUMBER(16),TASK_INFO_ID VARCHAR(32),CONS_ID NUMBER(16),SRV_DATE VARCHAR(32),ARRIVA_TIME VARCHAR(32),LEAVE_TIME VARCHAR(32),IS_DRUMB VARCHAR(8),END_DATE VARCHAR(32),WORK_RST VARCHAR(8),HOME_SITU VARCHAR(8),CONS_SATISFY VARCHAR(8),CONS_SIGN_FLAG VARCHAR(8),RST_DESC VARCHAR(1024),WORK_APPR_PER VARCHAR(32),WORK_EMP_NO VARCHAR(1024),WORK_EMP_NAME VARCHAR(32),CREATE_EMP_NAME VARCHAR(32),CREATE_TIME VARCHAR(32),CONS_IMPR_SUGG VARCHAR(4000),REMARK VARCHAR(4000),TASK_TYPE VARCHAR(8),VENTILATION_RESULT VARCHAR(8),CHG_COMMENT VARCHAR(256),IS_HAS_CDT VARCHAR(8),NODE_ID VARCHAR(32),VERIFI_FLAG VARCHAR(8),CLOSURE_CONTENT VARCHAR(8),M_CID VARCHAR(32),IS_APPO_VENT VARCHAR(8),APPO_VENT_TIME VARCHAR(32),NOVENT_REASON VARCHAR(8),FIELD_SITUA VARCHAR(8),TRANS_DEP VARCHAR(8),AIR_TIGHT VARCHAR(8),APP_UP_DOWN VARCHAR(8),APP_GRADE VARCHAR(8),METER_SUR VARCHAR2(32),IS_PLUG VARCHAR2(32),PLUG_TYPE VARCHAR2(32),SUPPORT_DEV_NO VARCHAR2(32),FACTORY_NUMBER VARCHAR2(32),CONTACT_TEL VARCHAR(32));"
		}, {
			"tableVersion": 1,
			"tableName": "MAIN_INFO_Table", //6.3.8现场维修信息
			"execSQL": "CREATE TABLE IF NOT EXISTS MAIN_INFO_Table(_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NO VARCHAR(16),CONS_NO VARCHAR(16),MAIN_RST_ID NUMBER(16),AP_MAIN_REGI_ID NUMBER(16),WORK_NO_STAT VARCHAR(16),ORG_NO VARCHAR(16),MAIN_TYPE VARCHAR(8),HOME_TIME VARCHAR(32),FINISH_DATE VARCHAR(32),INPUT_TIME VARCHAR(32),INPUT_PER VARCHAR(32),MAIN_CLASS VARCHAR(32),MAINTAIN_PER VARCHAR(32),MAIN_CONTENT VARCHAR(32),MAIN_CONTENT_TYPE VARCHAR(8),MAINTAIN_RST VARCHAR(4000),HANDLE_RST VARCHAR(8),MAINTAIN_PER_NO VARCHAR(256),MAINTAIN_PER_DEP VARCHAR(256),COMMENT_TYPE VARCHAR(8),MAIN_RST_NO VARCHAR(32));"
		}, {
			"tableVersion": 1,
			"tableName": "INST_DIS_INFO_Table", //6.3.3现场拆装信息
			"execSQL": "CREATE TABLE IF NOT EXISTS INST_DIS_INFO_Table(_id INTEGER PRIMARY KEY AUTOINCREMENT ,MP_INST_SCHE_ID NUMBER(16),APP_NO VARCHAR(16),CONS_NO VARCHAR(16),GM_IR_ID NUMBER(16),TASK_INFO_ID NUMBER(16),WORK_PER VARCHAR(256),WORK_DATE VARCHAR(32),REMARK VARCHAR(4000),M_CID VARCHAR(32));"
		}, {
			"tableVersion": 1,
			"tableName": "IN_DI_INFO", //6.3.5.1拆装表信息
			"execSQL": "CREATE TABLE IF NOT EXISTS IN_DI_INFO(_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NO VARCHAR(16),CONS_NO VARCHAR(16),CONS_ID NUMBER(16),GM_IR_ID NUMBER(16),MP_INST_SCHE_ID NUMBER(16),TASK_INFO_ID NUMBER(16),GM_ID NUMBER(16),INST_LOC VARCHAR2(8),IR_TYPE VARCHAR(8),INST_DATE VARCHAR(32),PUT_DATE VARCHAR(32),REMOVE_DATE VARCHAR(32),REMOVE_REA VARCHAR2(256),WORK_DATE VARCHAR(32),WORK_PER VARCHAR(256),VENT_STAT VARCHAR2(8),REF_METER_FLAG VARCHAR2(8),ORG_NO VARCHAR2(32),FACTORY_NUMBER VARCHAR2(32),BAR_CODE VARCHAR2(32),MATE_CODE VARCHAR2(32),MATE_DESC VARCHAR2(256),GM_APPLY_TYPE VARCHAR2(8),METER_TYPE VARCHAR2(8),PRODUCE_FACT VARCHAR2(8),PRODUCE_DATE VARCHAR2(32),RESE_METER_FLAG VARCHAR2(8),REMOTE_FLAG VARCHAR2(8),METER_BIT NUMBER(10,6),STATUS VARCHAR2(8),SUPPORT_EQUIP_ID NUMBER(16),REMARK VARCHAR2(4000),MODEL_NO VARCHAR2(8),FLOW_ARRAGE VARCHAR2(8),INTAKE_DIRE VARCHAR2(8),FACTORY_ID VARCHAR2(8),MP_ID NUMBER(16),DEAL_TYPE VARCHAR2(8),TRANSFER_FLAG VARCHAR2(8),FAULT_TYPE VARCHAR2(8),CARD_NO VARCHAR2(16),SEAL_NO VARCHAR2(64),M_CID VARCHAR2(32),CHANGESTATUS VARCHAR(8),DEAL_VALUE VARCHAR(8),REMOTE_DEV_TYPE VARCHAR(8),REMOTE_DEV_NO VARCHAR(64),LOGIC_ADDR VARCHAR(64));"
		}, {
			"tableVersion": 1,
			"tableName": "SUPP_DVE_INFO_Table", //6.3.5.3配套配置信息
			"execSQL": "CREATE TABLE IF NOT EXISTS SUPP_DVE_INFO_Table(_id INTEGER PRIMARY KEY AUTOINCREMENT,APP_NO VARCHAR(16),CONS_NO VARCHAR(16),MP_INST_SCHE_ID NUMBER(16),SUP_DEV_INST_ID NUMBER(16),IR_TYPE VARCHAR(8),GM_ID NUMBER(16),SUPPORT_DEV_ID NUMBER(16),SUPPORT_DEV_NO VARCHAR(32),SUPT_DEV_TYPE VARCHAR(8),QUANTITY NUMBER(16),IR_DATE VARCHAR(32),IR_PER VARCHAR(32),REMARK VARCHAR(256),THIS_MR NUMBER(18,6),IS_FLAG VARCHAR(8),CORREC_COE NUMBER(18,6),ORG_NO VARCHAR2(16),MP_ID NUMBER(16),M_CID VARCHAR(32),SEAL_LOC VARCHAR(64),TAG VARCHAR(32));"
		}, {
			"tableVersion": 1,
			"tableName": "DVE_INFO_Table", //6.3.3.3燃气设备信息
			"execSQL": "CREATE TABLE IF NOT EXISTS DVE_INFO_Table(_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NO VARCHAR(16),CONS_NO VARCHAR(16),SD_REHIST_ID NUMBER(16),MP_INST_SCHE_ID NUMBER(16),DEV_NO VARCHAR(32),DEV_NAME VARCHAR(256),DEV_TYPE VARCHAR(8),DEV_STAT VARCHAR(8),BAR_CODE VARCHAR(32),BRAND VARCHAR(256),PATTERN VARCHAR(256),FACTORY VARCHAR(256),INST_LOC VARCHAR(256),INTE_STYLE VARCHAR(8),QUANTITY NUMBER(16),RATED_FLOW NUMBER(18,6),OPEN_NGQ NUMBER(18,6),DAY_USE_GAS NUMBER(5),HOUR_USE_NGQ NUMBER(18,6),MAIN_PERIOD NUMBER(5),DEV_DESC VARCHAR(1024),SALE_WORK_NO VARCHAR(32),INST_DATE VARCHAR(32),INST_ORG VARCHAR(256),IS_PRIV_ACCESS VARCHAR(8),CP_SELF_FLAG VARCHAR(8),CONN_PIPE_TYPE VARCHAR(8),CONN_PIPE_DATE VARCHAR(32),CHG_TYPE VARCHAR(8),APPLICATION VARCHAR(8),EQUIP_ID NUMBER(16),CONS_ID NUMBER(16),MP_ID NUMBER(16),GAS_PRESSURE NUMBER(5),INTER_PATH NUMBER(5),INTE_HEIGHT NUMBER(5),EQUIP_TONNAGE NUMBER(8,2),REMOVE_DATE VARCHAR(32),M_CID VARCHAR(32));"
		}, {
			"tableVersion": 1,
			"tableName": "History_Repair_Table", //6.2.6 历史维修记录下载
			"execSQL": "CREATE TABLE IF NOT EXISTS History_Repair_Table(_id INTEGER PRIMARY KEY AUTOINCREMENT ,APPO_NO VARCHAR(16),AP_MAIN_REGI_ID NUMBER(16),APP_NO VARCHAR(16),CONS_NO VARCHAR(16),URGENCY_DEGREE VARCHAR(8),FAULT_DESC VARCHAR(1024),DIST_TIME VARCHAR(32),APPO_TIME VARCHAR(32));"
		}, {
			"tableVersion": 1,
			"tableName": "History_MAIN_INFO_Table", //6.3.8历史现场维修信息
			"execSQL": "CREATE TABLE IF NOT EXISTS History_MAIN_INFO_Table(_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NO VARCHAR(16),APPO_NO VARCHAR(16),CONS_NO VARCHAR(16),MAIN_RST_ID NUMBER(16),AP_MAIN_REGI_ID NUMBER(16),WORK_NO_STAT VARCHAR(16),ORG_NO VARCHAR(16),MAIN_TYPE VARCHAR(8),HOME_TIME VARCHAR(32),FINISH_DATE VARCHAR(32),INPUT_TIME VARCHAR(32),INPUT_PER VARCHAR(32),MAIN_CLASS VARCHAR(32),MAINTAIN_PER VARCHAR(32),MAIN_CONTENT VARCHAR(32),MAINTAIN_RST VARCHAR(4000),HANDLE_RST VARCHAR(8),MAINTAIN_PER_NO VARCHAR(256),MAINTAIN_PER_DEP VARCHAR(256),COMMENT_TYPE VARCHAR(8),MAIN_RST_NO VARCHAR(32));"
		}, {
			"tableVersion": 1,
			"tableName": "Plan_MP_INFO", //6.3.6.1供气点方案信息
			"execSQL": "CREATE TABLE IF NOT EXISTS Plan_MP_INFO(_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NO VARCHAR(16),CONS_NO VARCHAR(16),CONS_ID NUMBER(16),MP_INST_SCHE_ID NUMBER(16),CONS_APP_ID NUMBER(16),TASK_INFO_ID NUMBER(16), CHG_TYPE VARCHAR(8),GASSTATUS VARCHAR(8),MP_ID NUMBER(16),ADDR_ID NUMBER(16),MP_NO VARCHAR(16),MP_ADDR VARCHAR(256),INST_COND_FLAG VARCHAR(8),PIPE_NET_TYPE VARCHAR(8),HAS_SRC_TYPE VARCHAR(8),RISER_VENT_STAT VARCHAR(8),RISER_VENT_DATE VARCHAR(32),IN_INST_STAT VARCHAR(8),INST_DATE VARCHAR(32),PRO_ACPT_DATE VARCHAR(32),VENT_STAT VARCHAR(8),VENT_DATE VARCHAR(32),OPEN_PAY_FLAG VARCHAR(8),BELONG_REGU_BOX VARCHAR(32),METER_BOX_NO VARCHAR(16),BELONG_RISER_NO VARCHAR(16),ORG_NO VARCHAR(16),BELONG_AREA VARCHAR(16),LONGITUDE VARCHAR(32),LATITUDE VARCHAR(32),GAS_NARURE VARCHAR(8),GAS_SRC_TYPE VARCHAR(8),MP_STAT VARCHAR(8),TRADE_TYPE_CODE VARCHAR(8),CALC_MODE VARCHAR(8),MP_TYPE_CODE VARCHAR(8),MP_LEVEL NUMBER(5),PRC_CODE VARCHAR(32),TRADE_CODE VARCHAR(8),MP_STATUS VARCHAR(8),MR_SN NUMBER(5),TP_FACTOR NUMBER(18,6),PIPE_NET_NO VARCHAR(16),NO_VENT_DEAL VARCHAR(8),M_CID VARCHAR(32),GAS_USE VARCHAR(8),IS_INST_METER VARCHAR(8));"
		}, {
			"tableVersion": 1,
			"tableName": "READ_INFO", //6.3.5.46.3.5.3.1	拆装表读数信息（READ_INFO）
			"execSQL": "CREATE TABLE IF NOT EXISTS READ_INFO(_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NO VARCHAR(16),CONS_NO VARCHAR(16),IR_READ_ID NUMBER(16),GM_IR_ID NUMBER(16),TASK_INFO_ID NUMBER(16),GM_ID NUMBER(16),READ_TYPE_CODE VARCHAR2(8),START_READ NUMBER(18,6),ENABLE_READ NUMBER(18,6),PURCH_T_NGQ NUMBER(18,6),ELEC_METER_READ NUMBER(18,6),REMAIN_NGQ NUMBER(18,6),RS_GAS VARCHAR(8),LAST_YMD VARCHAR(32),LAST_MR NUMBER(18,6),THIS_YMD VARCHAR(32),THIS_MR NUMBER(18,6),LAST_READ_DATE VARCHAR(32),LAST_READ NUMBER(18,6),REMARK VARCHAR(256),TP_FACTOR NUMBER(18,4),IR_TYPE VARCHAR(8),MR_DIGIT NUMBER(18,6),EXCP_TYPE_CODE VARCHAR(8),MR_NGQ NUMBER(18,6));"
		}]
	}];
	AndroidApi.initCreateTables(JSON.stringify(repairDBSql), function(msg) {
		console.log("维修明细下载建表结束：" + msg);
	});
}
/**
 * 业办项目对应建表
 */
function initTransact() {
	var transactDBSql = [{
		"dbVersion": 1,
		"execTable": [{
			"tableVersion": 1,
			"tableName": "TRANSACT_TSINFO", //统一任务列表
			"execSQL": "CREATE TABLE IF NOT EXISTS TRANSACT_TSINFO (_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NO VARCHAR2(32),CONS_NO VARCHAR2(32),CONS_ID VARCHAR2(32),TS_TYPE VARCHAR2(8),APP_NAME VARCHAR2(256),ORG_NO VARCHAR2(16),CONS_NAME VARCHAR2(256),CONS_ADD VARCHAR2(256),APPO_START_TIME VARCHAR2(32),APPO_ARR_TIME VARCHAR2(32),APPO_PER VARCHAR2(256),CONTACT_TEL VARCHAR2(32),REMARK VARCHAR2(256),APP_ADDR VARCHAR2(4000),APP_LEVEL VARCHAR2(16),URGENCY_DEGREE VARCHAR2(8),MAIN_STAT VARCHAR2(8),APPOINT_TYPE VARCHAR2(8),USER VARCHAR2(32));"
		}, {
			"tableVersion": 1,
			"tableName": "TEST_INFO_Table", //6.3.17.16.3.13.1	现场试表信息（TEST_INFO）
			"execSQL": "CREATE TABLE IF NOT EXISTS TEST_INFO_Table(DEV_TEST_ID NUMBER(16),M_DEV_TEST_ID VARCHAR2(32),ORG_NO VARCHAR2(16),APP_NO VARCHAR2(16),CONS_NO VARCHAR2(32),CONS_ID NUMBER(16),GM_ID NUMBER(16),TEST_FNS_TIME DATE,WRITE_TIME DATE,TEST_ORG VARCHAR2(16),TEST_DEPT VARCHAR2(16),TEST_PER VARCHAR2(32),REMARK VARCHAR2(1024),TEST_RST VARCHAR2(256),TEST_NO VARCHAR2(64),RST_DESC VARCHAR2(1024),M_CID VARCHAR2(32),TEST_REAS VARCHAR2(32),TEST_READ VARCHAR2(32),APPEAR VARCHAR2(32),INDICAT VARCHAR2(32),INSTAN_FLOW VARCHAR2(32),PRESSURE VARCHAR2(32),SPARE_METER VARCHAR2(8),EQUI_NUM VARCHAR2(32),VALVE_SWITCH VARCHAR2(8));"
		}, {
			"tableVersion": 1,
			"tableName": "TEST_DTL_INFO_Table", //6.3.17.26.3.13.1.1	试表明细信息（TEST_DTL_INFO）
			"execSQL": "CREATE TABLE IF NOT EXISTS TEST_DTL_INFO_Table(_id INTEGER PRIMARY KEY AUTOINCREMENT,DEV_TEST_DTL_ID NUMBER(16),M_CID VARCHAR2(32),DEV_TEST_ID NUMBER(16),APP_NO VARCHAR2(16),CONS_NO VARCHAR2(16),ORG_NO VARCHAR2(16),TEST_ITEM VARCHAR2(8),TEST_RST VARCHAR2(8),TEST_RSQ VARCHAR2(256));"
		}, {
			"tableVersion": 1,
			"tableName": "PRO_INFO_Table", //6.3.1.1	现场勘查信息(PRO_INFO)
			"execSQL": "CREATE TABLE IF NOT EXISTS PRO_INFO_Table(HOME_EXPL_ID NUMBER(16),APP_NO VARCHAR2(16),CONS_NO VARCHAR2(16),TASK_TYPE VARCHAR2(8),WORK_RST VARCHAR2(8),HOME_SITU VARCHAR2(8),ARRIVA_TIME DATE,LEAVE_TIME DATE,WORK_EMP_NO VARCHAR2(32),WORK_EMP_NAME VARCHAR2(32),WORK_APPR_PER VARCHAR2(32),CONS_SATISFY VARCHAR2(8),CONS_SIGN_FLAG VARCHAR2(8),EXPL_TEAM VARCHAR2(256),EXPL_PER VARCHAR2(32),EXPL_ADDR VARCHAR2(256),HANDLE_METHOD VARCHAR2(8),PIC_DATA_TYPE VARCHAR2(8),CONTACT_NAME VARCHAR2(256),CONTACT_TEL VARCHAR2(32),IS_HAS_CDT VARCHAR2(8),IS_CORR_NOW VARCHAR2(8),CONS_DEMAND VARCHAR2(1024),CONS_OPIN VARCHAR2(1024),SITE_FLOW VARCHAR2(4000),CONS_ID NUMBER(16),IS_CHG_METER VARCHAR2(8),IS_BUDGET VARCHAR2(8),HOME_EXPL_NO VARCHAR2(32),PIPE_DESC VARCHAR2(8),GAS_ENVI VARCHAR2(8),GAS_USE VARCHAR2(8),ALARM_DEV VARCHAR2(8),PRE_BOX VARCHAR2(8),INS_PRO VARCHAR2(4000));"
		}, {
			"tableVersion": 1,
			"tableName": "PRO_ACCEPT_INFO_Table", //6.3.146.3.11.1	现场验收信息（PRO_ACCEPT_INFO）
			"execSQL": "CREATE TABLE IF NOT EXISTS PRO_ACCEPT_INFO_Table(CONS_NO VARCHAR2(16),PRO_ACPT_ID NUMBER(16),ACCEPT_TASK_NO VARCHAR2(16),ACCEPT_NUM NUMBER(5),REGU_BOX_NO VARCHAR2(32),ACCEPT_HOUSES NUMBER(18,6),ACCEPT_RST VARCHAR2(8),IS_HAS_INTE VARCHAR2(8),VENT_STAT VARCHAR2(8),FNS_ACPT_DATE DATE,ACCEPT_DESC VARCHAR2(4000),REMARK VARCHAR2(4000),REG_PER VARCHAR2(256),ACCEPT_DEPT VARCHAR2(1024),APP_NO VARCHAR2(16),REG_DATE DATE,IS_END_ACCEPT VARCHAR2(8),RECEIVE_TIME DATE,DATA_MARK VARCHAR2(32),PMS_DATAID VARCHAR2(32),M_CID VARCHAR2(32));"
		}, {
			"tableVersion": 1,
			"tableName": "ACCEPT_DTL_ONFO_Table", //6.3.156.3.11.1.1	验收明细信息（ACCEPT_DTL_ONFO）
			"execSQL": "CREATE TABLE IF NOT EXISTS ACCEPT_DTL_ONFO_Table(PRO_ACPT_DTL_ID NUMBER(16),PRO_ACPT_ID NUMBER(16),APP_NO VARCHAR2(16),CONS_NO VARCHAR2(16),ACCEPT_ITEM VARCHAR2(8),ACCEPT_DTL VARCHAR2(8),ACCEPT_RST VARCHAR2(8),FLAW_CONTENT VARCHAR2(4000),CORR_DEMAND VARCHAR2(4000),CORR_PERIOD DATE,CORR_DESC VARCHAR2(4000),CORR_FNS_DATE DATE,ACCEPT_DATE VARCHAR2(8),RECEIVE_TIME DATE,M_CID VARCHAR2(32));"
		}, {
			"tableVersion": 1,
			"tableName": "DESI_TASK_INFO_TABLE", //6.3.7.1	设计任务信息（DESI_TASK_INFO）
			"execSQL": "CREATE TABLE IF NOT EXISTS DESI_TASK_INFO_TABLE(DESIGN_TASK_ID NUMBER(16),APP_NO VARCHAR2(16),CONS_NO VARCHAR2(16),DESIGN_TASK_NO VARCHAR2(16),ITEM_SCALE VARCHAR2(8),DESI_TIME_LIMIT NUMBER(5),TRANSFER_PER VARCHAR2(32),FEEDBACK_DATA VARCHAR2(256),TRANSFER_DATA VARCHAR2(256),DMD_FNS_DATE DATE,M_DMD_FNS_DATE DATE,ENTR_ORG VARCHAR2(32),ENTR_DATE DATE,ACCEPT_ORG_NO VARCHAR2(16),ACCEPT_ORG_NAME VARCHAR2(256),ACCEPT_DEPT_NO VARCHAR2(32),ACPT_DEPT_NAME VARCHAR2(256),ACCEPT_PER VARCHAR2(32),ACCEPT_DATE DATE,FINISH_DATE DATE,TASK_DESC VARCHAR2(1024),DESI_RANGE VARCHAR2(1024),DESIGN_TYPE VARCHAR2(8),RECEIVE_TIME DATE,DATA_MARK VARCHAR2(32),DESI_SETTL_MODE VARCHAR2(32),TASK_ID VARCHAR2(32),DESIGN_INFO LIST,M_CID VARCHAR2(32))"
		}, {
			"tableVersion": 1,
			"tableName": "DESIGN_INFO_TABLE", //6.3.7.1.1	设计图纸信息（DESIGN_INFO）
			"execSQL": "CREATE TABLE IF NOT EXISTS DESIGN_INFO_TABLE(DESIGN_FILE_ID NUMBER(16),DESIGN_TASK_ID NUMBER(16),DESIGN_FILE_NO VARCHAR2(32),APP_NO VARCHAR2(16),CONS_NO VARCHAR2(16),IS_BUDGET VARCHAR2(8),PLAIT_PER VARCHAR2(32),DEFI_FNS_TIME DATE,IS_END VARCHAR2(8),START_DATE DATE,DESIGN_TASK_NO VARCHAR2(16),RECV_DATE DATE,RECV_PER VARCHAR2(32),MAX_PRESSURE NUMBER(18,6),MAX_FLOW NUMBER(18,6),END_REASON VARCHAR2(4000),RECV_STATUS VARCHAR2(32),RECEIVE_TIME DATE,DATA_MARK VARCHAR2(32),IS_DELAY VARCHAR2(8),DELAY_RESON VARCHAR2(1024),TASK_ID VARCHAR2(32),CUST_REPLY VARCHAR2(8),M_CID VARCHAR2(32))"
		}, {
			"tableVersion": 1,
			"tableName": "BUBGET_TASK_INFO_TABLE", //6.3.9.1	预算任务信息（BUBGET_TASK_INFO）
			"execSQL": "CREATE TABLE IF NOT EXISTS BUBGET_TASK_INFO_TABLE(BUDGET_TASK_ID NUMBER(16),APP_NO VARCHAR2(16),CONS_NO VARCHAR2(16),DESIGN_FILE_NO VARCHAR2(32),BUDGET_TASK_NO VARCHAR2(16),ENTR_PER VARCHAR2(32),ENTR_DATE DATE,ACCEPT_PER VARCHAR2(32),ACCEPT_DATE DATE,APPO_FINISH_TL NUMBER(5),BUDGET_TYPE VARCHAR2(8),TASK_ID VARCHAR2(32),RECEIVE_TIME DATE,BUBGET_DTL_INFO LIST,BUBGET_INFO LIST,M_CID VARCHAR2(32))"
		}, {
			"tableVersion": 1,
			"tableName": "BUBGET_DTL_INFO_TABLE", //6.3.9.1.1	预算费用明细（BUBGET_DTL_INFO）
			"execSQL": "CREATE TABLE IF NOT EXISTS BUBGET_DTL_INFO_TABLE(BUDGET_DTL_ID NUMBER(16),BUDGET_TASK_ID NUMBER(16),APP_NO VARCHAR2(16),CUST_NO VARCHAR2(16),CONS_NO VARCHAR2(16),CONTR_NO VARCHAR2(32),ITEM_NO VARCHAR2(32),ITEM_NAME VARCHAR2(256),BUSI_AMT_TYPE VARCHAR2(8),UNIT_PRICE NUMBER(12),PERIODS NUMBER(5),NOTIFY_NO VARCHAR2(16),BUDGET_AMT NUMBER(18),ORG_NO VARCHAR2(16),CONFIRM_EMP_NO VARCHAR2(32),NODE_ID VARCHAR2(16),REMARK VARCHAR2(4000),CONS_ID NUMBER(16),BUSI_RELE_ID NUMBER(16),PARAVALUE_ID NUMBER(16),QUANTITY NUMBER(16),S_UNIT_NAME VARCHAR2(20),M_CID VARCHAR2(32),MATE_LIST LIST)"
		}, {
			"tableVersion": 1,
			"tableName": "MATE_LIST_TABLE", //6.3.9.1.1.1	材料信息(MATE_LIST) ps:预算费用明细下的材料信息
			"execSQL": "CREATE TABLE IF NOT EXISTS MATE_LIST_TABLE(MAIN_MATE_ID NUMBER(16),APP_NO VARCHAR2(16),CONS_NO VARCHAR2(16),SUPPLY_CODE VARCHAR2(256),SUPPLY_NAME VARCHAR2(32),S_QUANTITY NUMBER(16),S_PRICE NUMBER(12),S_UNIT VARCHAR2(8),S_UNIT_NAME VARCHAR2(20),T_AMT NUMBER(18),M_CID VARCHAR2(32),DISCOUNT_FLAG VARCHAR2(8))"
		}, {
			"tableVersion": 1,
			"tableName": "BUBGET_INFO_TABLE", //6.3.9.1.2	编制预算信息（BUBGET_INFO）
			"execSQL": "CREATE TABLE IF NOT EXISTS BUBGET_INFO_TABLE(BUDGET_RST_ID NUMBER(16),BUDGET_TASK_ID NUMBER(16),APP_NO VARCHAR2(16),CONS_NO VARCHAR2(16),DESIGN_FILE_NO VARCHAR2(32),PLAIT_PER VARCHAR2(32),VERI_PER VARCHAR2(32),DELIVER_DATE DATE,ITEM_BUDGET_AMT NUMBER(18),DEPEND_STANDARD VARCHAR2(8),ACCEPT_PER VARCHAR2(32),ACCEPT_DEPT VARCHAR2(256),START_TIME DATE,END_TIME DATE,ETR_STAFF VARCHAR2(32),ETR_TIME DATE,IS_END VARCHAR2(8),END_REASON VARCHAR2(4000),TASK_ID VARCHAR2(32),RECEIVE_TIME DATE,M_CID VARCHAR2(32))"
		}]
	}];
	AndroidApi.initCreateTables(JSON.stringify(transactDBSql), function(msg) {
		console.log("业办建表结束：" + msg);
	});

}
/**
 * 安检项目对应建表
 */
function initSecuryty() {
	var securityDBSql = [{
		"dbVersion": 1,
		"execTable": [{
				"tableVersion": 1,
				"tableName": "SC_ITEM", //5.5.2.5.1	安检项信息
				"execSQL": "CREATE TABLE IF NOT EXISTS SC_ITEM(M_ORG_NO VARCHAR(16),SC_ITEM_ID NUMBER(16), USE_TYPE VARCHAR(8), SC_ITEM_TYPE VARCHAR(8), SCI_TYPE_NAME VARCHAR(32), ORG_NO VARCHAR(16), P_SC_ITEM_ID NUMBER(16), SEQ_LEVEL NUMBER(8), DISPLAY_SEQ NUMBER(5)); CREATE INDEX SC_ITEM_INDEX ON SC_ITEM( USER_NO,SC_ITEM_ID);"
			}, {
				"tableVersion": 1,
				"tableName": "SC_ITEM_DTL", //5.5.2.5.2	安检项明细信息 SC_ITEM_DTL.SC_ITEM_ID与SC_ITEM.SC_ITEM_ID关联
				"execSQL": "CREATE TABLE IF NOT EXISTS SC_ITEM_DTL( SC_ITEM_DTL_ID NUMBER(16) NOT NULL, SC_ITEM_ID NUMBER(16) NOT NULL, ATTR_CODE VARCHAR(32), ATTR_NAME VARCHAR(32), ATTR_VALUE_TYPE VARCHAR(8), HIDDEN_LEVEL VARCHAR(8), DISPLAY_SEQ NUMBER(5), TEAM_NO NUMBER(5), IS_APPEND_CONT VARCHAR(8),ORG_NO VARCHAR(16),IS_SELECT VARCHAR(8),IS_MR_SC VARCHAR(8),SC_HANDLE_MODE VARCHAR(8),CORR_STYLE VARCHAR(8),IS_HIDDEN VARCHAR(8)); CREATE INDEX SC_ITEM_DTL_INDEX ON SC_ITEM_DTL( SC_ITEM_ID);"
			}, {
				"tableVersion": 1,
				"tableName": "TS_DTL_Table",
				"execSQL": "CREATE TABLE IF NOT EXISTS TS_DTL_Table (_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NO VARCHAR(16),BUSI_TYPE VARCHAR(8),CONS_NO VARCHAR(16),LAST_SC_DATE VARCHAR(16),MY_ROWNUM INTEGER,ORG_NO VARCHAR(16),PLAN_SC_DATE VARCHAR(16),PLAN_TYPE VARCHAR(8),SC_PDTL_ID NUMBER(16),SC_STAT VARCHAR(8));"
			},
			{
				"tableVersion": 1,
				"tableName": "SC_RST_Table",
				"execSQL": "CREATE TABLE IF NOT EXISTS SC_RST_Table (_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NO VARCHAR(16),CONS_NO VARCHAR(16),ACTUAL_SC_DATE VARCHAR(16),CORR_NOTICE_NO VARCHAR(32),INPUT_USE_NO VARCHAR(16),IS_FLAG VARCHAR(8),SCL_CONTACT_TEL VARCHAR(32),SCL_SIGNATURE VARCHAR(32),SC_PDTL_ID NUMBER(16),SC_RST_ID NUMBER(16),SC_RST_NO VARCHAR(32),SC_SUMSARY VARCHAR(256),SC_WORK_NO VARCHAR(32),VISIT_RST VARCHAR(8),ACTUAL_SC_PER VARCHAR(32),IS_DRUMB VARCHAR(8),SC_DRU VARCHAR(8),CAP_NUM NUMBER(5));"
			}, {
				//新增CORR_RST 整改结果scmCorrRst HAND_SITU
				"tableVersion": 1,
				"tableName": "SC_RST_DTL_Table",
				"execSQL": "CREATE TABLE IF NOT EXISTS SC_RST_DTL_Table (_id INTEGER PRIMARY KEY AUTOINCREMENT ,APPEND_VAL VARCHAR(1024),ATTR_NAME VARCHAR(32),CODE_VAL VARCHAR(8),CORR_STYLE VARCHAR(8),DTL_ID NUMBER(16),METER_ID VARCHAR(16),SC_ITEM_TYPE VARCHAR(8),SC_RST_NO VARCHAR(32),SC_PDTL_ID NUMBER(16),SC_RST_ID NUMBER(16),CORR_RST VARCHAR2(8),HAND_SITU VARCHAR2(4000));"
			}, {
				"tableVersion": 1,
				"tableName": "TSINFO_Table",
				"execSQL": "CREATE TABLE IF NOT EXISTS TSINFO_Table (_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NAME VARCHAR(256),UNFINISH_NUM NUMBER(5),APP_NO VARCHAR(16),PLAN_BGN_DATE VARCHAR2(32),PLAN_END_DATE VARCHAR2(32),BUSI_NAME VARCHAR2(256),STATUS VARCHAR(8),TS_TYPE VARCHAR(8),PLAN_TYPE VARCHAR2(8),EMP_NO VARCHAR2(16),BUSI_NO VARCHAR2(16),CUST_ADDR VARCHAR2(256),PLAN_NUM NUMBER(5),FINISH_NUM NUMBER(5),EXCP_NUM NUMBER(5),APP_LEVEL VARCHAR2(16),URGENCY_DEGREE VARCHAR2(8),PLAN_STATUS NUMBER(8),ORG_NO VARCHAR(16),isChoose VARCHAR2(8));"
			}, {
				"tableVersion": 1,
				"tableName": "History_TS_DTL", //5.5.15.5.1	任务明细信息
				"execSQL": "CREATE TABLE IF NOT EXISTS History_TS_DTL(APPO_NO VARCHAR(16), APP_NO VARCHAR(16), SC_PDTL_ID NUMBER(32),CONS_NO VARCHAR(16), LAST_SC_DATE VARCHAR(16), PLAN_SC_DATE VARCHAR(16), SC_STAT VARCHAR(8), PLAN_TYPE VARCHAR(8), ORG_NO VARCHAR(16), BUSI_TYPE VARCHAR(8),SERIAL_NO NUMBER(32));"
			}, {
				"tableVersion": 1,
				"tableName": "History_SC_RST", //5.5.15.5.2	安检结果信息
				"execSQL": "CREATE TABLE IF NOT EXISTS History_SC_RST(SC_PDTL_ID NUMBER(16), SC_RST_ID NUMBER(16), SC_RST_NO VARCHAR(32), ACTUAL_SC_DATE VARCHAR(16), ACTUAL_SC_PER VARCHAR(16), VISIT_RST VARCHAR(8), IS_FLAG VARCHAR(8),BUSI_TYPE VARCHAR(8));"
			}, {
				"tableVersion": 1,
				"tableName": "History_SC_RST_DTL", //5.5.15.5.3	安检结果明细信息
				"execSQL": "CREATE TABLE IF NOT EXISTS History_SC_RST_DTL(BUSI_TYPE VARCHAR(8),SC_RST_NO VARCHAR(32),SC_RST_ID NUMBER(16), DTL_ID NUMBER(16), METER_ID VARCHAR(16), SC_ITEM_TYPE VARCHAR(8),CODE_VAL VARCHAR(16),APPEND_VAL VARCHAR(1024),CORR_STYLE VARCHAR(8));"
			}
		]
	}];
	AndroidApi.initCreateTables(JSON.stringify(securityDBSql), function(msg) {});

}
/**
 * 初始化套餐列表
 */
function initMaterial() {
	var materialDBSql = [{
		"dbVersion": 1,
		"execTable": [{
			"tableVersion": 1,
			"tableName": "PACK_LIST",
			"execSQL": "CREATE TABLE IF NOT EXISTS PACK_LIST(M_ORG_NO VARCHAR2(16),ORG_NO VARCHAR2(16), PACKAGE_ID NUMBER(16), PACKAGE_NO VARCHAR2(32), PACKAGE_NAME VARCHAR2(64), PACKAGE_AMT NUMBER(18,2),CREATE_EMP_NO VARCHAR2(32),IS_EFFECT VARCHAR2(8) );"
		}, {
			"tableVersion": 1,
			"tableName": "MATERIAL_LIST",
			"execSQL": "CREATE TABLE IF NOT EXISTS MATERIAL_LIST(M_ORG_NO VARCHAR2(16),PART_ID NUMBER(16),PACKAGE_ID NUMBER(16),PART_NO VARCHAR2(32),PART_NAME VARCHAR2(256),UNIT VARCHAR2(8),UNIT_PRICE NUMBER(12,4),PRICE NUMBER(12,4),USE_LIMIT VARCHAR2(32),ORG_NO VARCHAR2(16));"
		}]
	}];

	AndroidApi.initCreateTables(JSON.stringify(materialDBSql), function(msg) {
		console.log("套餐表建表结束：" + JSON.stringify(msg));
	});
}
/**
 * 初始化收费
 */
function initCharge() {
	var chargeInfo = JSON.stringify([{
		"dbVersion": 1,
		"execTable": [{
			"tableVersion": 1,
			"tableName": "METER_READING_CHARGE_LIST", //收费信息
			"execSQL": "CREATE TABLE IF NOT EXISTS METER_READING_CHARGE_LIST (_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NO VARCHAR2(32),CONS_NO VARCHAR2(32),SN VARCHAR2(16),SETTLE_MODE VARCHAR2(8),PAY_MODE VARCHAR2(16),CHARGE_EMP_NO VARCHAR2(32),RCV_AMT NUMBER(18,2),CHARGE_TIME VARCHAR2(32),PAY_STATUS VARCHAR2(32),AMT NUMBER(18,2),PRE_PRICE NUMBER(18,2),RCV_COUNT VARCHAR2(32),UP_STATUS_NAME VARCHAR2(256));"
		}, {
			"tableVersion": 1,
			"tableName": "BOOK_INFO", //业务费信息
			"execSQL": "CREATE TABLE IF NOT EXISTS BOOK_INFO (_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NO VARCHAR2(32),CONS_NO VARCHAR2(32),SN VARCHAR2(16),AMT_ID NUMBER(16),AMT_NAME VARCHAR2(32),AMT_PRICE NUMBER(18,2),AMT_QUANTITY NUMBER(5),T_AMT NUMBER(18,2),M_CID VARCHAR2(32),IS_PACK NUMBER(2));"
		}, {
			"tableVersion": 1,
			"tableName": "MATE_LIST", //业务费信息
			"execSQL": "CREATE TABLE IF NOT EXISTS MATE_LIST (_id INTEGER PRIMARY KEY AUTOINCREMENT ,APP_NO VARCHAR2(32),CONS_NO VARCHAR2(32),M_CID VARCHAR2(32),SUPPLY_CODE VARCHAR2(256),SUPPLY_NAME VARCHAR2(32),S_QUANTITY NUMBER(16),S_PRICE NUMBER(12,4),S_UNIT VARCHAR2(8),T_AMT NUMBER(18,2),DISCOUNT_FLAG VARCHAR2(8),MAIN_MATE_ID NUMBER(16));"
		}]
	}]);
	AndroidApi.initCreateTables(chargeInfo, function(msg) {
		console.log("建表结束：" + JSON.stringify(msg));
	});
}
/**
 * 单一气价建表
 */
function initSinglePrice() {
	var SinglePrice = [{
		"dbVersion": 1,
		"execTable": [{
			"tableVersion": 1,
			"tableName": "SINGLE_PRICE", //单一气价信息
			"execSQL": "CREATE TABLE IF NOT EXISTS SINGLE_PRICE(PRC_ID NUMBER(16),PRC_CODE VARCHAR(16),PRC_NAME VARCHAR(256),BEGIN_DATE VARCHAR(32),END_DATE VARCHAR(32),ORG_NO VARCHAR(16),GAS_PRO VARCHAR(8),TRADE_CODE VARCHAR(8));"
		}, {
			"tableVersion": 1,
			"tableName": "P_SCOPE_TABLE", //单一气价信息
			"execSQL": "CREATE TABLE IF NOT EXISTS P_SCOPE_TABLE(PRC_CODE VARCHAR(16),RANGE_ID NUMBER(16),PRC_ID NUMBER(16),RULE_TYPE_CODE VARCHAR(8),RULE_CODE VARCHAR(16),BGN_VALUE NUMBER(16),END_VALUE NUMBER(16),CAT_PRC NUMBER(12,4));"
		}]
	}];
	AndroidApi.initCreateTables(JSON.stringify(SinglePrice), function(msg) {
		console.log("单一气价信息：" + msg);
	});

}

/**
 * 用户阶梯档案表
 */
function initUserFloor() {
	var userFloorDBSql = [{
		"dbVersion": 1,
		"execTable": [{
			"tableVersion": 1,
			"tableName": "CONSLADDER_INF", //6.15.2.1	用户阶梯档案
			"execSQL": "CREATE TABLE IF NOT EXISTS CONSLADDER_INF(APP_NO VARCHAR(16),CONS_NO VARCHAR2(16),ACCU_GQ_ID NUMBER(16),CONS_ID NUMBER(16),PRC_CODE VARCHAR2(16),PATCH_NO VARCHAR2(16),CALC_START_YMD VARCHAR2(8),CALC_END_YMD VARCHAR2(8));CREATE INDEX CONSLADDER_INF_INDEX ON CONSLADDER_INF( CONS_NO );"
		}, {
			"tableVersion": 1,
			"tableName": "DET_INFO", //6.15.2.2	用户阶梯档案规则
			"execSQL": "CREATE TABLE IF NOT EXISTS DET_INFO(APP_NO VARCHAR(16),CONS_NO VARCHAR2(16),ACCU_GQ_ID NUMBER(16),LEV_NUM VARCHAR2(16),LEV_GQ NUMBER(18,6),LEV_GQ_SUM NUMBER(18,6),LEV_GQ_REMAIN NUMBER(18,6),CAT_PRC LEV_GQ_REMAIN NUMBER(18,6));CREATE INDEX DET_INFO_INDEX ON DET_INFO( CONS_NO );"
		}]
	}];
	AndroidApi.initCreateTables(JSON.stringify(userFloorDBSql), function(msg) {
		console.log("用户阶梯档案建表结束：" + msg);
	});

}
//收费结果
function initChargeResult() {
	let sql = "CREATE TABLE IF NOT EXISTS CHARGE_ID_INFO( " +
		"SN VARCHAR2(16)," //流水号
		+
		"CONS_NO VARCHAR2(16), " //用户编号
		+
		"ACCT_NO  VARCHAR2(32), " //缴费批次             
		+
		"CASHCHK_ID NUMBER(16)," //解款编号
		+
		"RCV_DATE  VARCHAR2(8), " //实收日期
		+
		"CHARGE_TIME  VARCHAR2(256), " //实收时间
		+
		"SETTLE_MODE  VARCHAR2(8)," //结算方式
		+
		"PAY_MODE   VARCHAR2(8)," //缴费方式
		+
		"CHARGE_EMP_NO  VARCHAR2(32)," //收费员
		+
		"RCV_AMT  NUMBER(16)," //收款金额
		+
		"RCV_ORG_NO  VARCHAR2(32)," //收款单位
		+
		"RCV_ORG_NAME  VARCHAR2(256)," //收款单位名称
		+
		"FEE_TYPE   VARCHAR2(8)," //费用类型
		+
		"ORDER_NO  VARCHAR2(32)," //订单编号
		+
		"APP_NO  VARCHAR2(32), " //工单编号
		+
		"HAND_OVER VARCHAR2(32)" //交接标识
		+
		");";

	var chargeDBSql = [{
		"dbVersion": 1,
		"execTable": [{
			"tableVersion": 1,
			"tableName": "CHARGE_ID_INFO",
			"execSQL": sql
		}]
	}];

	AndroidApi.initCreateTables(JSON.stringify(chargeDBSql), function(msg) {
		console.log("收费表建表结束：" + JSON.stringify(msg));
	});
}
/*移动催费相关表*/
function initArrageUser() {
	var userInfoDBSql = [{
		"dbVersion": 1,
		"execTable": [{
			"tableVersion": 1,
			"tableName": "CUST_ARREARINFO", //6.2.1.1	用户基本信息（CUST_ADDRINFO）
			"execSQL": "CREATE TABLE IF NOT EXISTS CUST_ARREARINFO(" +
				"CONS_NO VARCHAR(16)," +
				"CONS_NAME VARCHAR(256)," +
				"CONS_ADDR VARCHAR(256)," +
				"ORG_NO VARCHAR(16), " +
				"ORG_NAME VARCHAR(256), " +
				"CONS_SORT_CODE VARCHAR(8)," +
				"GAS_NARURE VARCHAR(8), " +
				"CONS_STAT VARCHAR(8), " +
				"ABLE_BAL NUMBER(16)," +
				"OWE NUMBER(16)," +
				"MY_ROWNUM NUMBER(16)," +
				"CONS_SORT_CODE_NAME VARCHAR(16)," +
				"PREPAY_BAL  NUMBER(16)," +
				"GAS_NARURE_NAME VARCHAR(256)," +
				"CONS_STAT_NAME VARCHAR(16)," +
				"QUERY_TYPE  VARCHAR(8)," +
				"MR_SECT_NAME  VARCHAR(256)," +
				"MR_SECT_NO_BGN VARCHAR(256)," +
				"MR_SECT_NO_END VARCHAR(256)," +
				"METER_NO   VARCHAR(16)," +
				"TEL   VARCHAR(16)" +
				");"
		}, {
			"tableVersion": 1,
			"tableName": "OWE_PAYED", //已交现金的欠费信息
			"execSQL": "CREATE TABLE IF NOT EXISTS OWE_PAYED(" +
				"RCVBL_GAS_ID VARCHAR(256)," +
				"RCVBL_YM VARCHAR(256)," +
				"DEADLINE_DATE VARCHAR(256)," +
				"RCVBL_AMT VARCHAR(256), " +
				"PENALTY VARCHAR(256)," +
				"OWE_TOTAL_AMT VARCHAR(256)," +
				"SN VARCHAR(256) " +
				");"
		}]
	}];

	AndroidApi.initCreateTables(JSON.stringify(userInfoDBSql), function(msg) {
		// console.log("用户信息表建表结束：" + msg);
	});

}
/**
 * 用户档案信息建表（添加/修改）
 * CHANGE_TYPE :
 * 新增： 1
 * 修改： 2
 * 上传成功： 3
 * M_CID : getsn -> getScRstNo(cons_no)
 *  
 * 
 */
function initUserChange() {
	var userInfoDBSqlChnage = [{
		"dbVersion": 1,
		"execTable": [{
				"tableVersion": 1,
				"tableName": "CUST_ADDRINFO_CHANGE", //6.2.1.1	用户基本信息（CUST_ADDRINFO）
				"execSQL": "CREATE TABLE IF NOT EXISTS CUST_ADDRINFO_CHANGE( M_CID VARCHAR(32),CHANGE_TYPE VARCHAR(8),TS_TYPE VARCHAR(8), APP_NO VARCHAR(16), CUST_NO VARCHAR(16), CUST_TYPE VARCHAR(8), CUST_NAME VARCHAR(256), CUST_ADDR VARCHAR(256), CONS_NO VARCHAR(16), ORGN_CONS_NO VARCHAR(32),CONS_STAT VARCHAR(8), CONS_NAME VARCHAR(256),CONS_ADDR VARCHAR(256),USER_DOC VARCHAR(8),GAS_NARURE VARCHAR(8),FLAG_CODE VARCHAR(32),SC_TYPE VARCHAR(16),LAST_CHK_DATE VARCHAR(16),ORG_NO VARCHAR(16),PRESENT_NAME VARCHAR(256),CONS_SORT_CODE VARCHAR(16),RESIDENT_POPU NUMBER(5)); CREATE INDEX CUST_ADDRINFO_INDEX ON CUST_ADDRINFO( APP_NO,CONS_NO );"
			}, {
				"tableVersion": 1,
				"tableName": "CUST_CONTACTINFO_CHANGE", //6.2.1.2	联系信息（CUST_CONTACTINFO）
				"execSQL": "CREATE TABLE IF NOT EXISTS CUST_CONTACTINFO_CHANGE(M_CID VARCHAR(32),CONTACT_ID NUMBER(16) NOT NULL,CHANGE_TYPE VARCHAR(8),TS_TYPE VARCHAR(8),APP_NO VARCHAR(16),CONS_NO VARCHAR(16),CONTACT_NAME VARCHAR(32),RELATION VARCHAR(8),SEX VARCHAR(8),CONTACT_TYPE VARCHAR(8),CONTACT_PRIO NUMBER(5),REMARK VARCHAR(1024),CERT_TYPE VARCHAR2(8),CERT_NUM VARCHAR2(32));CREATE INDEX CUST_CONTACTINFO_INDEX ON CUST_CONTACTINFO( APP_NO,CONS_NO);"
			}, {
				"tableVersion": 1,
				"tableName": "CONT_CHANL_CHANGE", //6.2.1.2.1	联系方式信息（CONT_ CHANL） CUST_CONTACTINFO.CONTACT_ID与CONT_CHANL.CONTACT_ID关联
				"execSQL": "CREATE TABLE IF NOT EXISTS CONT_CHANL_CHANGE(M_CID VARCHAR(32),CHANGE_TYPE VARCHAR(8),APP_NO VARCHAR(16),CONS_NO VARCHAR(16),CONS_C_CHANL_ID NUMBER(16) NOT NULL,CONTACT_ID NUMBER(16) NOT NULL,CONT_CHANL_TYPE VARCHAR(8),CONT_CHANL_NO VARCHAR(32),PRIORITY NUMBER(5));CREATE INDEX CONT_CHANL_INDEX ON CONT_CHANL( CONTACT_ID);"
			}, {
				"tableVersion": 1,
				"tableName": "CUST_GMINFO_CHANGE", //6.2.1.3	表具信息（CUST_GMINFO）
				"execSQL": "CREATE TABLE IF NOT EXISTS CUST_GMINFO_CHANGE(M_CID VARCHAR(32),CHANGE_TYPE VARCHAR(8),TS_TYPE VARCHAR(8),APP_NO VARCHAR(16),CONS_NO VARCHAR(16),MR_SECT_NO VARCHAR(16),MR_SN NUMBER(5),VENT_DATE VARCHAR(16),PURCH_GAS_TIME VARCHAR(16),THIS_YMD VARCHAR(16),LAST_MR NUMBER(16,6),METER_ID NUMBER(6),GM_APPLY_TYPE VARCHAR(8),PRODUCE_FACT VARCHAR(8),METER_MODEL VARCHAR(32),ASSET_NO VARCHAR(32),INTAKE_DIRE VARCHAR(8),INST_LOC VARCHAR(256),MR_DIGIT NUMBER(5),T_FACTOR NUMBER(16),PURCH_T_CAP NUMBER(18,6),MP_ID NUMBER(16),ORG_NO VARCHAR(16),ACCU_PURCH_GC VARCHAR(32) );CREATE INDEX CUST_GMINFO_INDEX ON CUST_GMINFO( APP_NO,CONS_NO);"
			}, {
				"tableVersion": 1,
				"tableName": "CUST_PRODINFO_CHANGE", //6.2.1.4	燃气设备信息（CUST_PRODINFO）
				"execSQL": "CREATE TABLE IF NOT EXISTS CUST_PRODINFO_CHANGE(M_CID VARCHAR(32),CHANGE_TYPE VARCHAR(8),TS_TYPE VARCHAR(8),APP_NO VARCHAR(16),CONS_NO VARCHAR(16),FACTORY_NUMBER VARCHAR(32),EQUIP_ID NUMBER(16),MP_ID NUMBER(16),EQUIT_TYPE VARCHAR(8),EQUIT_USE VARCHAR(32),EQUIT_USE_TYPE VARCHAR(32),EQUIP_INS_MODE VARCHAR(32),PROD_TYPE_NO VARCHAR(16),PROD_BRAND VARCHAR(256),PROD_MODEL VARCHAR(32),PROD_BAR VARCHAR(256),PURCHASE_TIME VARCHAR(16),INST_DATE VARCHAR(16),INST_ADD VARCHAR(256),QUANTITY NUMBER(5),ORG_NO VARCHAR(16));CREATE INDEX CUST_PRODINFO_INDEX ON CUST_PRODINFO( APP_NO,CONS_NO);"
			}, {
				"tableVersion": 1,
				"tableName": "PIPE_VALVEINFO_CHANGE", //6.2.1.5	管线阀门信息（PIPE_VALVEINFO）
				"execSQL": "CREATE TABLE IF NOT EXISTS PIPE_VALVEINFO_CHANGE(M_CID VARCHAR(32),CHANGE_TYPE VARCHAR(8),FACILITY_ID NUMBER(16),FACILITY_CODE VARCHAR2(8),FACILITY_TYPE VARCHAR2(8),FACILITY_NAME VARCHAR2(8),FACILITY_MODEL VARCHAR2(8),FACILITY_QUALITY VARCHAR2(8),CONNECTION_MODE VARCHAR2(8),INSTALL_MODE VARCHAR2(8),CURRENT_STATE VARCHAR2(8),FACILITY_SOURCE VARCHAR2(8),REMARK VARCHAR2(1024),OPERAT_PRESSURE VARCHAR2(32),FACTORY VARCHAR2(32),FACILITY_NUM VARCHAR2(32),ADDR_POSITION VARCHAR2(256),SC_DATE VARCHAR2(32),ORG_NO VARCHAR2(16),CONS_NO VARCHAR2(16),P_FACILITY_ID VARCHAR2(32),RELA_FACILITY_ID NUMBER(16),FACILITY_LEVEL VARCHAR2(16),FACILITY_CONFIGURE VARCHAR2(16),FACILITY_NO VARCHAR2(16),P_M_CID VARCHAR2(32))"
			}, {
				"tableVersion": 1,
				"tableName": "CONS_LABLEINFO_CHANGE", //6.2.1.6 用户标签信息（CONS_LABLEINFO）
				"execSQL": "CREATE TABLE IF NOT EXISTS CONS_LABLEINFO_CHANGE(M_CID VARCHAR(32),CHANGE_TYPE VARCHAR(8),CONS_NO VARCHAR(16),LABLE_TYPE VARCHAR(8),LABLE_VALUE VARCHAR(8),LABLE_DESC VARCHAR(256),USE_TYPE VARCHAR(8),UDP_TYPE VARCHAR(8),UDP_DATE VARCHAR(16),UDP_EMP VARCHAR(256),FLAG_TYPE VARCHAR(16));CREATE INDEX CONS_LABLEINFO_INDEX ON CONS_LABLEINFO( CONS_NO );"
			}, {
				"tableVersion": 1,
				"tableName": "TS_RES_CHANGE", //6.2.1.7	抄表信息（TS_RES）
				"execSQL": "CREATE TABLE IF NOT EXISTS TS_RES_CHANGE(M_CID VARCHAR(32),CHANGE_TYPE VARCHAR(8),APP_NO VARCHAR(16),CONS_NO VARCHAR(16),MR_TYPE_CODE NUMBER(8),THIS_YMD VARCHAR(16),LAST_MR_NUM NUMBER(18,6),THIS_READ NUMBER(18,6),THIS_READ_GQ NUMBER(18,6),ELEC_METER_READ NUMBER(18,6),REMAIN_GAS NUMBER(18,6),EXCP_TYPE_CODE VARCHAR(8),MR_SN NUMBER(5),T_FACTOR NUMBER(16),MR_DIGIT NUMBER(5),ORG_NO VARCHAR(8));CREATE INDEX TS_RES_INDEX ON TS_RES( APP_NO,CONS_NO );"
			}, {
				"tableVersion": 1,
				"tableName": "INSU_INFO_CHANGE", //6.2.1.8	保险信息（INSU_INFO）
				"execSQL": "CREATE TABLE IF NOT EXISTS INSU_INFO_CHANGE(M_CID VARCHAR(32),CHANGE_TYPE VARCHAR(8),INSUR_PROD VARCHAR(256),CONS_NO VARCHAR(16),INSUR_TYPE VARCHAR(8),COPIES VARCHAR(8),AMT NUMBER(18,2),SAFE_PERIOD VARCHAR(8),SAFE_BGN_DATE VARCHAR(16),SAFE_END_DATE VARCHAR(16));CREATE INDEX INSU_INFO_INDEX ON INSU_INFO( CONS_NO );"
			},
			{
				"tableVersion": 1,
				"tableName": "CERT_LIST_CHANGE", //6.2.1.9	证件信息（CERT_LIST）	
				"execSQL": "CREATE TABLE IF NOT EXISTS CERT_LIST_CHANGE(CHANGE_TYPE VARCHAR(8),APP_NO VARCHAR2(16),CUST_NO VARCHAR2(16),CERT_ID NUMBER(16),M_CID VARCHAR2(32),CERT_TYPE VARCHAR2(8),CERT_NAME VARCHAR2(256),GIVE_CERT_ANENT VARCHAR2(256),CERT_NUM VARCHAR2(32),CARD_DATE VARCHAR2(32),VALID_PERIOD NUMBER (5),EFFECT_TIME VARCHAR2(32),INVALID_TIME VARCHAR2(32),SAVE_LOC VARCHAR2(256),REMARK VARCHAR2(1024),ORG_NO VARCHAR2(16))"
			},
			{
				"tableVersion": 1,
				"tableName": "BANK_LIST_CHANGE", //6.2.1.10	银行信息（BANK_LIST）
				"execSQL": "CREATE TABLE IF NOT EXISTS BANK_LIST_CHANGE(CHANGE_TYPE VARCHAR(8),APP_NO VARCHAR2(16),CONS_NO VARCHAR2(16),ACCT_ID NUMBER(16),M_CID VARCHAR2(32),PRIORITY VARCHAR2(8),BANK_CODE VARCHAR2(8),BANK_ACCT VARCHAR2(32),ACCOUNT_NAME VARCHAR2(256),REMARK VARCHAR2(256),ORG_NO VARCHAR2(16))"
			},
			{
				"tableVersion": 1,
				"tableName": "NOTE_INFO_CHANGE", //6.2.1.11	开票信息（NOTE_INFO）
				"execSQL": "CREATE TABLE IF NOT EXISTS NOTE_INFO_CHANGE(M_CID VARCHAR(32),CHANGE_TYPE VARCHAR(8),APP_NO VARCHAR2(16),CONS_NO VARCHAR2(16),VAT_NAME VARCHAR2(256),VAT_NO VARCHAR2(32),VAT_ACCT VARCHAR2(32),BANK_CODE VARCHAR2(256),REG_ADDR VARCHAR2(256),VAT_ADDR VARCHAR2(256),BILL_TYPE VARCHAR2(32),DRAW_BILL_TYPE VARCHAR2(32))"
			},
			{
				"tableVersion": 1,
				"tableName": "MP_INFO_CHANGE", //6.2.1.12	供气点信息(MP_INFO)
				"execSQL": "CREATE TABLE IF NOT EXISTS MP_INFO_CHANGE(M_CID VARCHAR(32),CHANGE_TYPE VARCHAR(8),APP_NO VARCHAR2(16),CONS_NO VARCHAR2(16),MP_ID NUMBER(16),ADDR_ID NUMBER(16),MP_NO VARCHAR2(16),MP_ADDR VARCHAR2(256),INST_COND_FLAG VARCHAR2(8),PIPE_NET_TYPE VARCHAR2(8),HAS_SRC_TYPE VARCHAR2(8),RISER_VENT_STAT VARCHAR2(8),RISER_VENT_DATE VARCHAR2(32),IN_INST_STAT VARCHAR2(8),INPIPE_LAY_TYPE VARCHAR2(8),INST_DATE VARCHAR2(32),PRO_ACPT_DATE VARCHAR2(32),VENT_STAT VARCHAR2(8),VENT_DATE VARCHAR2(32),OPEN_PAY_FLAG VARCHAR2(8),BELONG_REGU_BOX VARCHAR2(32),METER_BOX_NO VARCHAR2(16),BELONG_RISER_NO VARCHAR2(16),ORG_NO VARCHAR2(16),BELONG_AREA VARCHAR2(16),LONGITUDE VARCHAR2(32),LATITUDE VARCHAR2(32),GAS_NARURE VARCHAR2(8),CONS_ID NUMBER(16),CALC_MODE VARCHAR2(8),MP_TYPE_CODE VARCHAR2(8),MP_LEVEL NUMBER(5),PRC_CODE VARCHAR2(32),TRADE_CODE VARCHAR2(8),MP_STATUS VARCHAR2(8),MR_SN NUMBER(5),TP_FACTOR NUMBER(18,6),PIPE_NET_NO VARCHAR2(16),FACILITY_NO VARCHAR2(16),NO_VENT_DEAL VARCHAR2(8),GAS_USE VARCHAR2(8));"
			},
			{
				"tableVersion": 1,
				"tableName": "CUST_COUTRACTINFO_CHANGE", //6.2.1.13	合同信息(CUST_COU)
				"execSQL": "CREATE TABLE IF NOT EXISTS CUST_COUTRACTINFO_CHANGE(M_CID VARCHAR(32),CHANGE_TYPE VARCHAR(8),APP_NO VARCHAR2(16),CONS_NO VARCHAR2(16),CONT_ID NUMBER(16),CONS_ID NUMBER(16),CONT_NO VARCHAR2(32),FILE_NAME VARCHAR2(256),ELEC_FILE_NAME VARCHAR2(32),CT_CONTACT_NO VARCHAR2(16),CONT_MODEL VARCHAR2(8),CONTR_SORT VARCHAR2(8),CONT_STAT VARCHAR2(8),SIGN_PER VARCHAR2(256),SIGN_ADDR VARCHAR2(256),CONT_SIGN_DATE VARCHAR2(32),EFFECT_DATE VARCHAR2(32),VALID_PERIOD NUMBER(5),END_DATE VARCHAR2(32),SUPPLY_SIGN_PER VARCHAR2(32),REMARK VARCHAR2(1024),FOREIG NUMBER(16),ORG_NO VARCHAR2(16),CERT_TYPE VARCHAR2(8),CERT_NUM VARCHAR2(32),CONT_PHONE VARCHAR2(32),CANCE_REA VARCHAR2(256),CANCE_OPER VARCHAR2(16),SIGN_TYPE VARCHAR2(8),SIGN_CHANNEL VARCHAR2(8),SIGN_ORG_NO VARCHAR2(16),BUILD_AREA VARCHAR2(32),AGENT VARCHAR2(256),AGENT_NAME VARCHAR2(32),AGENT_CERT_TYPE VARCHAR2(8),AGENT_CERT_NUM VARCHAR2(32),AGENT_TEL VARCHAR2(32),HOUSING_AREA NUMBER(8,2),PRC_CODE VARCHAR2(16))"
			}, {
				"tableVersion": 1,
				"tableName": "CONTR_BASE_INFO_CHANGE", //6.2.1.13.1	合同用气信息
				"execSQL": "CREATE TABLE IF NOT EXISTS CONTR_BASE_INFO_CHANGE(M_CID VARCHAR(32),CHANGE_TYPE VARCHAR(8),BASE_INFO_ID NUMBER(16),CONT_ID NUMBER(16),GAS_NARURE VARCHAR2(8),PRC_TYPE VARCHAR2(16),PRE_GAS_AMT NUMBER(18,2),GM_TYPE VARCHAR2(8),FLOW NUMBER(18,6),APP_RUN_CAP NUMBER(18,6),YEAT_RUN_CAP NUMBER(18,6),PRC_CODE VARCHAR2(16),PRC_NAME VARCHAR2(32),ORG_NO VARCHAR2(16))"
			}, {
				"tableVersion": 1,
				"tableName": "CONTR_SUB_INFO_CHANGE", //6.2.1.13.1	合同用气信息
				"execSQL": "CREATE TABLE IF NOT EXISTS CONTR_SUB_INFO_CHANGE(M_CID VARCHAR(32),CHANGE_TYPE VARCHAR(8),CONT_SUB_ID NUMBER(16),CONT_ID NUMBER(16),SUB_TYPE VARCHAR2(8),CUST_NAME VARCHAR2(256),REG_PERSON VARCHAR2(32),REG_ADDR VARCHAR2(256),AUTH_AGENT VARCHAR2(32),TEL VARCHAR2(32),FAX VARCHAR2(32),POSTAL_CODE VARCHAR2(16),OPEN_BANK VARCHAR2(32),BANK_ACCT VARCHAR2(32),TAX_REGIST_NO VARCHAR2(32),ORG_NO VARCHAR2(16))"
			}
		]
	}];
	AndroidApi.initCreateTables(JSON.stringify(userInfoDBSqlChnage), function(msg) {
		console.log("change用户信息表建表结束:", msg);
	});

	var userAccountDBSqlChange = [{
		"dbVersion": 1,
		"execTable": [{
			"tableVersion": 1,
			"tableName": "ACCOUNT_LIST_CHANGE", //5.5.15.3.1	用户账户信息
			"execSQL": "CREATE TABLE IF NOT EXISTS ACCOUNT_LIST_CHANGE(M_CID VARCHAR(32),CHANGE_TYPE VARCHAR(8),CONS_NO VARCHAR(16),COMMI_CHARGE_BANK VARCHAR(256),BANK_ACCT VARCHAR(32),UPDATE_TIME VARCHAR(16),ACCOUNT_BAL NUMBER(18,2),PREPAY_BAL NUMBER(18,2),OWE_BAL NUMBER(18,2),PENALTY_AMT NUMBER(18,2),OWE_NUM NUMBER(8));CREATE INDEX ACCOUNT_LIST_INDEX ON ACCOUNT_LIST( CONS_NO );"
		}, {
			"tableVersion": 1,
			"tableName": "OWE_LIST_CHANGE", //5.5.15.3.2	欠费明细信息
			"execSQL": "CREATE TABLE IF NOT EXISTS OWE_LIST_CHANGE(M_CID VARCHAR(32),CHANGE_TYPE VARCHAR(8),CONS_NO VARCHAR(16), RCVBL_YM VARCHAR(6),RELEASE_DATE VARCHAR(8),THIS_READ NUMBER(18,2),SETTLE_TQ NUMBER(18,2),RCVBL_AMT NUMBER(18,2),RCVED_AMT NUMBER(18,2),PENALTY NUMBER(18,2),OWE_TOTAL_AMT NUMBER(18,2),DEADLINE_DATE VARCHAR(16),SETTLE_FLAG VARCHAR(8));CREATE INDEX OWE_LIST_INDEX ON OWE_LIST( APP_NO,CUST_NO,CONS_NO);"
		}, {
			"tableVersion": 1,
			"tableName": "PAY_LIST_CHANGE", //5.5.15.3.3	缴费记录信息
			"execSQL": "CREATE TABLE IF NOT EXISTS PAY_LIST_CHANGE(M_CID VARCHAR(32),CHANGE_TYPE VARCHAR(8),CONS_NO VARCHAR(16),PAY_MODE VARCHAR(8),SETTLE_MODE VARCHAR(8),TYPE_CODE VARCHAR(8),CHARGE_EMP_NO VARCHAR(256),RCVED_DATE VARCHAR(8),CHARGE_TIME VARCHAR(16),PAY_AMT NUMBER(18,2),RCVED_AMT NUMBER(18,2),PENALTY_AMT NUMBER(18,2),PREPAY_AMT NUMBER(18,2),BUSI_AMT NUMBER(18,2),ADD_AMT NUMBER(18,2));CREATE INDEX PAY_LIST_INDEX ON PAY_LIST( APP_NO );"
		}]
	}];
	AndroidApi.initCreateTables(JSON.stringify(userAccountDBSqlChange), function(msg) {
		console.log("change用户账号信息建表结束：", msg);
	});
}
/**
 * 微应用公用数据库创建(关联表)
 * DIRECTION_NO 证件正反面（1 正面 2 反面）
 * CONTACT_CID -> M_CID
 */
/**
 * 表名：CONTACT_FILE_RELATION 联系信息图片关联表
 * 字段信息： M_CID getsn()
 *           CONTACT_CID -> 联系信息查询M_CID
 *           FILE_ID 上传图片返回的FILE_ID
 *           DIRECTION_TYPE 证件正反面的type （1 正面， 2 反面）
 * 
 * 表名：CONTRACT_FILE_RELATION 合同信息图片关联表
 * 字段信息： M_CID getsn()
 *           CONTRACT_CID -> 合同信息查询M_CID
 *           FILE_ID 上传图片返回的FILE_ID
 *           DIRECTION_TYPE 证件正反面的type （1 正面， 2 反面）
 * 
 * 表名：TICKET_FILE_RELATION 开票信息图片关联表
 * 字段信息： M_CID getsn()
 *           TICKET_CID -> 开票信息查询M_CID
 *           FILE_ID 上传图片返回的FILE_ID
 */
function initRelation() {
	var fileDBSqlRelation = [{
		"dbVersion": 1,
		"execTable": [{
				"tableVersion": 1,
				"tableName": "CONTACT_FILE_RELATION",
				"execSQL": "CREATE TABLE IF NOT EXISTS CONTACT_FILE_RELATION(M_CID VARCHAR2(32),CONTACT_CID VARCHAR2(32),FILE_ID VARCHAR2(32),DIRECTION_TYPE VARCHAR2(16));"
			},
			{
				"tableVersion": 1,
				"tableName": "CONTRACT_FILE_RELATION",
				"execSQL": "CREATE TABLE IF NOT EXISTS CONTRACT_FILE_RELATION(M_CID VARCHAR2(32),CONTRACT_CID VARCHAR2(32),FILE_ID VARCHAR2(32),DIRECTION_TYPE VARCHAR2(16));"
			},
			{
				"tableVersion": 1,
				"tableName": "TICKET_FILE_RELATION",
				"execSQL": "CREATE TABLE IF NOT EXISTS TICKET_FILE_RELATION(M_CID VARCHAR2(32),TICKET_CID VARCHAR2(32),FILE_ID VARCHAR2(32));"
			}
		]
	}];
	AndroidApi.initCreateTables(JSON.stringify(fileDBSqlRelation), function(msg) {
		console.log("图片关联表建表结束：" + JSON.stringify(msg));
	});
}

/**
 * 巡检录入信息
 * CHANGE_TYPE 1 添加 2 修改 3 提交成功
 */
function inspectionInfo() {
	var userFloorDBSql = [{
		"dbVersion": 1,
		"execTable": [{
			"tableVersion": 1,
			"tableName": "INSP_RST_INFO", // 6.22.4.1 巡检结果信息
			"execSQL": "CREATE TABLE IF NOT EXISTS INSP_RST_INFO(CONS_NO VARCHAR2(16),CHANGE_TYPE VARCHAR2(16),DEV_INSP_ID NUMBER(16),ORG_NO VARCHAR2(16),APP_NO VARCHAR2(16),CONS_ID NUMBER(16),GM_ID NUMBER(16),ARRI_SITE_TIME VARCHAR2(32),INSP_FNS_TIME VARCHAR2(32),WRITE_TIME VARCHAR2(32),INSP_RST VARCHAR2(8),INSP_ORG VARCHAR2(16),INSP_DEPT VARCHAR2(16),INSP_PER VARCHAR2(32),BEG_READ NUMBER(18, 6),END_READ NUMBER(18, 6),M_CID  VARCHAR2(32),WORK_RST VARCHAR2(8),RST_DESC VARCHAR2(2014),HOME_SITU VARCHAR2(8),EXISTS_PROB VARCHAR2(256),FIX_CONTENT VARCHAR2(256),INSP_ADVICE VARCHAR2(256))"
		}, {
			"tableVersion": 1,
			"tableName": "INSP_DTL_INFO", //  6.22.4.1.1 巡检记录明细
			"execSQL": "CREATE TABLE IF NOT EXISTS INSP_DTL_INFO(DEV_INSP_DTL_ID NUMBER(16),DEV_INSP_ID NUMBER(16),ORG_NO VARCHAR2(16),INSP_ITEM VARCHAR2(8),INSP_RST VARCHAR2(256),M_CID VARCHAR2(32))"
		}]
	}];
	AndroidApi.initCreateTables(JSON.stringify(userFloorDBSql), function(msg) {
		console.log("用户阶梯档案建表结束：" + msg);
	});

}


/**
* 检定录入信息
* CHANGE_TYPE 1 添加 2 修改 3 提交成功
*/
function verificationInfo() {
  var userFloorDBSql = [{
    "dbVersion": 1,
    "execTable": [{
      "tableVersion": 1,
      "tableName": "D_CHK_INFO", // 6.3.16.1 表具送检信息
      "execSQL": "CREATE TABLE IF NOT EXISTS D_CHK_INFO(M_CID VARCHAR2(32),CONS_NO VARCHAR2(16),CHANGE_TYPE VARCHAR2(16),VERIFY_RST_ID  NUMBER(16),ORG_NO VARCHAR2(16),ACPT_BUSI_TYPE VARCHAR2(8),APP_NO VARCHAR2(16),CONS_ID NUMBER(16),GM_ID NUMBER(16),CENS_STYLE VARCHAR2(8),CENS_TIME VARCHAR2(8),CENS_PER VARCHAR2(32),CENS_ORG VARCHAR2(16),VERIFY_TYPE VARCHAR2(8),VERIFY_ORG VARCHAR2(16),VERIFY_DATE VARCHAR2(8),VERIFY_CONC VARCHAR2(8),REMARK VARCHAR2(256),REMOTE_READ VARCHAR2(32),REMOTE_LEVEL VARCHAR2(32),REMOTE_STAT VARCHAR2(8))"
    }, {
      "tableVersion": 1,
      "tableName": "CHK_DTL_INFO", // 6.3.16.1.1 检定明细信息
      "execSQL": "CREATE TABLE IF NOT EXISTS CHK_DTL_INFO(M_CID VARCHAR2(32),VERIFY_RST_ID NUMBER(16),VERIFY_ID NUMBER(16),ORG_NO VARCHAR2(16),VERIFY_ITEM VARCHAR2(8),VERIFY_REQ VARCHAR2(64),ITEM_TYPE VARCHAR2(8))"
    }]
  }];
  AndroidApi.initCreateTables(JSON.stringify(userFloorDBSql), function(msg) {
    console.log("用户阶梯档案建表结束：" + msg);
  });

}



/**
* 保养录入信息
* CHANGE_TYPE 1 添加 2 修改 3 提交成功
*/
function maintenanceInfo() {
  var userFloorDBSql = [{
    "dbVersion": 1,
    "execTable": [{
      "tableVersion": 1,
      "tableName": "MIAN_RST_INFO", // 6.3.16.1 表具送检信息
      "execSQL": "CREATE TABLE IF NOT EXISTS MIAN_RST_INFO(DEV_MAIN_ID NUMBER(16),ORG_NO VARCHAR2(16),CHANGE_TYPE VARCHAR2(16),APP_NO VARCHAR2(16),CONS_ID NUMBER(16),GM_ID NUMBER(16),ARRI_SITE_TIME DATE,MAIN_FNS_TIME DATE,WRITE_TIME DATE,MAIN_ORG VARCHAR2(16),MAIN_DEPT VARCHAR2(16),MAIN_PER VARCHAR2(32),CHK_RUSLT VARCHAR2(254),MAC_READ NUMBER(18,6),AFTER_MAIN_READ NUMBER(18,6),ADD_OIL VARCHAR2(8),CLEAN_FILTER VARCHAR2(8),HOME_SITU VARCHAR2(8),WORK_RST VARCHAR2(8),M_CID VARCHAR2(32),FAULT_DESC VARCHAR2(256),FAULT_REA VARCHAR2(256),MAIN_CONTENT VARCHAR2(256))"
    }, {
      "tableVersion": 1,
      "tableName": "MIAN_DTL_INFO", // 6.3.16.1.1 检定明细信息
      "execSQL": "CREATE TABLE IF NOT EXISTS MIAN_DTL_INFO(DEV_MAIN_DTL_ID NUMBER(16),DEV_MAIN_ID NUMBER(16),ORG_NO VARCHAR2(16),MAIN_ITEM VARCHAR2(8),MAIN_RST VARCHAR2(256),M_CID VARCHAR2(32))"
    }]
  }];
  AndroidApi.initCreateTables(JSON.stringify(userFloorDBSql), function(msg) {
    console.log("用户阶梯档案建表结束：" + msg);
  });

}

export {
	initDB
};
